@lifi/sdk-provider-ethereum 4.2.12 → 4.3.1
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.
- package/CHANGELOG.md +61 -0
- package/dist/cjs/EthereumProvider.d.ts +1 -4
- package/dist/cjs/EthereumProvider.js +1 -2
- package/dist/cjs/actions/checkPermitSupport.d.ts +1 -4
- package/dist/cjs/actions/checkPermitSupport.js +5 -6
- package/dist/cjs/actions/checkPermitSupport.js.map +1 -1
- package/dist/cjs/actions/constants.d.ts +1 -4
- package/dist/cjs/actions/constants.js +1 -2
- package/dist/cjs/actions/getAccountCode.d.ts +1 -4
- package/dist/cjs/actions/getAccountCode.js +1 -2
- package/dist/cjs/actions/getAllowance.d.ts +2 -5
- package/dist/cjs/actions/getAllowance.js +6 -7
- package/dist/cjs/actions/getAllowance.js.map +1 -1
- package/dist/cjs/actions/getEthereumBalance.d.ts +1 -4
- package/dist/cjs/actions/getEthereumBalance.js +1 -2
- package/dist/cjs/actions/getMaxPriorityFeePerGas.d.ts +1 -4
- package/dist/cjs/actions/getMaxPriorityFeePerGas.js +3 -4
- package/dist/cjs/actions/getMaxPriorityFeePerGas.js.map +1 -1
- package/dist/cjs/actions/getMulticallAddress.d.ts +1 -4
- package/dist/cjs/actions/getMulticallAddress.js +1 -2
- package/dist/cjs/actions/isBatchingSupported.d.ts +1 -4
- package/dist/cjs/actions/isBatchingSupported.js +1 -2
- package/dist/cjs/actions/isSafeSignature.d.ts +2 -5
- package/dist/cjs/actions/isSafeSignature.js +3 -3
- package/dist/cjs/actions/isSafeSignature.js.map +1 -1
- package/dist/cjs/actions/isSafeWallet.d.ts +1 -4
- package/dist/cjs/actions/isSafeWallet.js +2 -3
- package/dist/cjs/actions/isSmartContractWallet.d.ts +1 -4
- package/dist/cjs/actions/isSmartContractWallet.js +1 -2
- package/dist/cjs/actions/resolveENSAddress.d.ts +1 -4
- package/dist/cjs/actions/resolveENSAddress.js +1 -2
- package/dist/cjs/actions/resolveEthereumAddress.d.ts +1 -4
- package/dist/cjs/actions/resolveEthereumAddress.js +1 -2
- package/dist/cjs/actions/resolveTransactionHash.d.ts +1 -4
- package/dist/cjs/actions/resolveTransactionHash.js +7 -4
- package/dist/cjs/actions/resolveTransactionHash.js.map +1 -1
- package/dist/cjs/actions/resolveUNSAddress.d.ts +1 -4
- package/dist/cjs/actions/resolveUNSAddress.js +2 -3
- package/dist/cjs/actions/setAllowance.d.ts +3 -6
- package/dist/cjs/actions/setAllowance.js +10 -7
- package/dist/cjs/actions/setAllowance.js.map +1 -1
- package/dist/cjs/actions/waitForBatchTransactionReceipt.d.ts +1 -4
- package/dist/cjs/actions/waitForBatchTransactionReceipt.js +1 -2
- package/dist/cjs/actions/waitForRelayedTransactionReceipt.d.ts +2 -5
- package/dist/cjs/actions/waitForRelayedTransactionReceipt.js +50 -12
- package/dist/cjs/actions/waitForRelayedTransactionReceipt.js.map +1 -1
- package/dist/cjs/actions/waitForSafeTransactionExecution.d.ts +1 -4
- package/dist/cjs/actions/waitForSafeTransactionExecution.js +2 -3
- package/dist/cjs/actions/waitForTransactionReceipt.d.ts +1 -4
- package/dist/cjs/actions/waitForTransactionReceipt.js +1 -2
- package/dist/cjs/client/publicClient.d.ts +1 -4
- package/dist/cjs/client/publicClient.js +1 -2
- package/dist/cjs/client/safeClient.d.ts +1 -4
- package/dist/cjs/client/safeClient.js +1 -2
- package/dist/cjs/client/types.d.ts +1 -4
- package/dist/cjs/core/EthereumStepExecutor.d.ts +1 -4
- package/dist/cjs/core/EthereumStepExecutor.js +6 -7
- package/dist/cjs/core/EthereumStepExecutor.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumBatchedSignAndExecuteTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumBatchedSignAndExecuteTask.js +5 -3
- package/dist/cjs/core/tasks/EthereumBatchedSignAndExecuteTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumBatchedWaitForTransactionTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumBatchedWaitForTransactionTask.js +1 -2
- package/dist/cjs/core/tasks/EthereumBatchedWaitForTransactionTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumCheckAllowanceAfterPrepareTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumCheckAllowanceAfterPrepareTask.js +1 -2
- package/dist/cjs/core/tasks/EthereumCheckAllowanceAfterPrepareTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumCheckAllowanceTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumCheckAllowanceTask.js +3 -4
- package/dist/cjs/core/tasks/EthereumCheckAllowanceTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumCheckBalanceTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumCheckBalanceTask.js +3 -3
- package/dist/cjs/core/tasks/EthereumCheckBalanceTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumCheckPermitsTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumCheckPermitsTask.js +2 -3
- package/dist/cjs/core/tasks/EthereumNativePermitTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumNativePermitTask.js +5 -6
- package/dist/cjs/core/tasks/EthereumNativePermitTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumPermit2AllowanceTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumPermit2AllowanceTask.js +1 -2
- package/dist/cjs/core/tasks/EthereumPrepareTransactionTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumPrepareTransactionTask.js +7 -6
- package/dist/cjs/core/tasks/EthereumPrepareTransactionTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumRelayedSignAndExecuteTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumRelayedSignAndExecuteTask.js +3 -4
- package/dist/cjs/core/tasks/EthereumRelayedWaitForTransactionTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumRelayedWaitForTransactionTask.js +2 -3
- package/dist/cjs/core/tasks/EthereumRelayedWaitForTransactionTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumResetAllowanceTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumResetAllowanceTask.js +6 -6
- package/dist/cjs/core/tasks/EthereumResetAllowanceTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumSetAllowanceTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumSetAllowanceTask.js +7 -7
- package/dist/cjs/core/tasks/EthereumSetAllowanceTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumSignAndExecuteTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumSignAndExecuteTask.js +2 -3
- package/dist/cjs/core/tasks/EthereumSignAndExecuteTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumStandardSignAndExecuteTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumStandardSignAndExecuteTask.js +6 -6
- package/dist/cjs/core/tasks/EthereumStandardSignAndExecuteTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumStandardWaitForTransactionTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumStandardWaitForTransactionTask.js +1 -2
- package/dist/cjs/core/tasks/EthereumStandardWaitForTransactionTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumWaitForTransactionStatusTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumWaitForTransactionStatusTask.js +1 -2
- package/dist/cjs/core/tasks/EthereumWaitForTransactionTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumWaitForTransactionTask.js +2 -3
- package/dist/cjs/core/tasks/helpers/estimateTransactionRequest.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/estimateTransactionRequest.js +3 -4
- package/dist/cjs/core/tasks/helpers/estimateTransactionRequest.js.map +1 -1
- package/dist/cjs/core/tasks/helpers/findSignedNativePermit.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/findSignedNativePermit.js +2 -3
- package/dist/cjs/core/tasks/helpers/getApprovalAmount.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/getApprovalAmount.js +2 -3
- package/dist/cjs/core/tasks/helpers/getEthereumExecutionStrategy.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/getEthereumExecutionStrategy.js +6 -4
- package/dist/cjs/core/tasks/helpers/getEthereumExecutionStrategy.js.map +1 -1
- package/dist/cjs/core/tasks/helpers/getTxLink.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/getTxLink.js +1 -2
- package/dist/cjs/core/tasks/helpers/getUpdatedStep.d.ts +10 -5
- package/dist/cjs/core/tasks/helpers/getUpdatedStep.js +11 -20
- package/dist/cjs/core/tasks/helpers/getUpdatedStep.js.map +1 -1
- package/dist/cjs/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.js +1 -2
- package/dist/cjs/core/tasks/helpers/hasPermit2AllowanceInFlight.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/hasPermit2AllowanceInFlight.js +1 -2
- package/dist/cjs/core/tasks/helpers/isAllowancePreparedForAnotherStrategy.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/isAllowancePreparedForAnotherStrategy.js +1 -2
- package/dist/cjs/core/tasks/helpers/isTypedDataAlreadySigned.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/isTypedDataAlreadySigned.js +1 -2
- package/dist/cjs/core/tasks/helpers/preservePermit2Allowances.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/preservePermit2Allowances.js +1 -2
- package/dist/cjs/core/tasks/helpers/resolveAllowanceSpender.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/resolveAllowanceSpender.js +1 -2
- package/dist/cjs/core/tasks/helpers/resolvePermit2Support.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/resolvePermit2Support.js +1 -2
- package/dist/cjs/core/tasks/helpers/shouldCheckForAllowance.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/shouldCheckForAllowance.js +2 -2
- package/dist/cjs/core/tasks/helpers/shouldCheckForAllowance.js.map +1 -1
- package/dist/cjs/core/tasks/helpers/signHyperliquidTypedData.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/signHyperliquidTypedData.js +3 -4
- package/dist/cjs/core/tasks/helpers/signHyperliquidTypedData.js.map +1 -1
- package/dist/cjs/core/tasks/helpers/signTypedDataEntries.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/signTypedDataEntries.js +1 -2
- package/dist/cjs/core/tasks/helpers/signTypedDataEntries.js.map +1 -1
- package/dist/cjs/core/tasks/helpers/switchChain.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/switchChain.js +1 -2
- package/dist/cjs/core/tasks/helpers/updateActionWithReceipt.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/updateActionWithReceipt.js +1 -2
- package/dist/cjs/errors/parseEthereumErrors.d.ts +1 -4
- package/dist/cjs/errors/parseEthereumErrors.js +3 -3
- package/dist/cjs/errors/parseEthereumErrors.js.map +1 -1
- package/dist/cjs/hyperliquid/agentWallet.d.ts +1 -4
- package/dist/cjs/hyperliquid/agentWallet.js +1 -2
- package/dist/cjs/hyperliquid/isHyperliquidAgentStep.d.ts +1 -4
- package/dist/cjs/hyperliquid/isHyperliquidAgentStep.js +1 -2
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +8 -8
- package/dist/cjs/permits/acceptsRawEcdsaSignature.d.ts +1 -4
- package/dist/cjs/permits/acceptsRawEcdsaSignature.js +1 -2
- package/dist/cjs/permits/allowanceTransfer.d.ts +1 -4
- package/dist/cjs/permits/allowanceTransfer.js +1 -2
- package/dist/cjs/permits/allowanceTransfer.js.map +1 -1
- package/dist/cjs/permits/canAccountUseNativePermits.d.ts +1 -4
- package/dist/cjs/permits/canAccountUseNativePermits.js +1 -2
- package/dist/cjs/permits/canAccountUsePermit2.d.ts +1 -4
- package/dist/cjs/permits/canAccountUsePermit2.js +1 -2
- package/dist/cjs/permits/constants.d.ts +1 -4
- package/dist/cjs/permits/constants.js +1 -2
- package/dist/cjs/permits/domain.d.ts +1 -4
- package/dist/cjs/permits/domain.js +1 -2
- package/dist/cjs/permits/encodeNativePermitData.d.ts +1 -4
- package/dist/cjs/permits/encodeNativePermitData.js +1 -2
- package/dist/cjs/permits/encodePermit2Data.d.ts +1 -4
- package/dist/cjs/permits/encodePermit2Data.js +1 -2
- package/dist/cjs/permits/getNativePermit.d.ts +1 -4
- package/dist/cjs/permits/getNativePermit.js +7 -8
- package/dist/cjs/permits/getNativePermit.js.map +1 -1
- package/dist/cjs/permits/getPermitTransferFromValues.d.ts +1 -4
- package/dist/cjs/permits/getPermitTransferFromValues.js +2 -3
- package/dist/cjs/permits/getPermitTransferFromValues.js.map +1 -1
- package/dist/cjs/permits/invariant.d.ts +1 -4
- package/dist/cjs/permits/invariant.js +1 -2
- package/dist/cjs/permits/isDelegationDesignatorCode.d.ts +1 -4
- package/dist/cjs/permits/isDelegationDesignatorCode.js +1 -2
- package/dist/cjs/permits/isNativePermitValid.d.ts +1 -4
- package/dist/cjs/permits/isNativePermitValid.js +2 -3
- package/dist/cjs/permits/isNativePermitValid.js.map +1 -1
- package/dist/cjs/permits/signPermit2Message.d.ts +1 -4
- package/dist/cjs/permits/signPermit2Message.js +1 -2
- package/dist/cjs/permits/signPermit2Message.js.map +1 -1
- package/dist/cjs/permits/signatureTransfer.d.ts +1 -4
- package/dist/cjs/permits/signatureTransfer.js +1 -2
- package/dist/cjs/permits/signatureTransfer.js.map +1 -1
- package/dist/cjs/permits/types.d.ts +1 -4
- package/dist/cjs/types.d.ts +7 -4
- package/dist/cjs/types.js +1 -2
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/utils/abi.d.ts +1 -4
- package/dist/cjs/utils/abi.js +1 -2
- package/dist/cjs/utils/convertExtendedChain.d.ts +1 -4
- package/dist/cjs/utils/convertExtendedChain.js +1 -2
- package/dist/cjs/utils/getActionWithFallback.d.ts +2 -4
- package/dist/cjs/utils/getActionWithFallback.js +3 -4
- package/dist/cjs/utils/getActionWithFallback.js.map +1 -1
- package/dist/cjs/utils/getDomainChainId.d.ts +1 -4
- package/dist/cjs/utils/getDomainChainId.js +1 -2
- package/dist/cjs/utils/getSafeApiKey.d.ts +1 -4
- package/dist/cjs/utils/getSafeApiKey.js +1 -2
- package/dist/cjs/utils/getSendChain.d.ts +2 -0
- package/dist/cjs/utils/getSendChain.js +6 -0
- package/dist/cjs/utils/getSendChain.js.map +1 -0
- package/dist/cjs/utils/getTypedDataLane.d.ts +1 -4
- package/dist/cjs/utils/getTypedDataLane.js +1 -2
- package/dist/cjs/utils/isContractCallStep.d.ts +1 -4
- package/dist/cjs/utils/isContractCallStep.js +1 -2
- package/dist/cjs/utils/isExtendedChain.d.ts +1 -4
- package/dist/cjs/utils/isExtendedChain.js +1 -2
- package/dist/cjs/utils/isGaslessStep.d.ts +8 -4
- package/dist/cjs/utils/isGaslessStep.js +8 -2
- package/dist/cjs/utils/isGaslessStep.js.map +1 -1
- package/dist/cjs/utils/isValidSignature.d.ts +1 -4
- package/dist/cjs/utils/isValidSignature.js +1 -2
- package/dist/cjs/utils/isZeroAddress.d.ts +1 -4
- package/dist/cjs/utils/isZeroAddress.js +1 -2
- package/dist/cjs/utils/median.d.ts +1 -4
- package/dist/cjs/utils/median.js +1 -2
- package/dist/cjs/version.d.ts +1 -4
- package/dist/cjs/version.js +2 -3
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/EthereumProvider.d.ts +0 -2
- package/dist/esm/EthereumProvider.d.ts.map +1 -1
- package/dist/esm/EthereumProvider.js +1 -2
- package/dist/esm/actions/checkPermitSupport.d.ts +0 -2
- package/dist/esm/actions/checkPermitSupport.d.ts.map +1 -1
- package/dist/esm/actions/checkPermitSupport.js +5 -6
- package/dist/esm/actions/checkPermitSupport.js.map +1 -1
- package/dist/esm/actions/constants.d.ts +0 -2
- package/dist/esm/actions/constants.d.ts.map +1 -1
- package/dist/esm/actions/constants.js +1 -2
- package/dist/esm/actions/getAccountCode.d.ts +0 -2
- package/dist/esm/actions/getAccountCode.d.ts.map +1 -1
- package/dist/esm/actions/getAccountCode.js +1 -2
- package/dist/esm/actions/getAllowance.d.ts +1 -3
- package/dist/esm/actions/getAllowance.d.ts.map +1 -1
- package/dist/esm/actions/getAllowance.js +6 -7
- package/dist/esm/actions/getAllowance.js.map +1 -1
- package/dist/esm/actions/getEthereumBalance.d.ts +0 -2
- package/dist/esm/actions/getEthereumBalance.d.ts.map +1 -1
- package/dist/esm/actions/getEthereumBalance.js +1 -2
- package/dist/esm/actions/getMaxPriorityFeePerGas.d.ts +1 -3
- package/dist/esm/actions/getMaxPriorityFeePerGas.d.ts.map +1 -1
- package/dist/esm/actions/getMaxPriorityFeePerGas.js +3 -4
- package/dist/esm/actions/getMaxPriorityFeePerGas.js.map +1 -1
- package/dist/esm/actions/getMulticallAddress.d.ts +0 -2
- package/dist/esm/actions/getMulticallAddress.d.ts.map +1 -1
- package/dist/esm/actions/getMulticallAddress.js +1 -2
- package/dist/esm/actions/isBatchingSupported.d.ts +0 -2
- package/dist/esm/actions/isBatchingSupported.d.ts.map +1 -1
- package/dist/esm/actions/isBatchingSupported.js +1 -2
- package/dist/esm/actions/isSafeSignature.d.ts +1 -3
- package/dist/esm/actions/isSafeSignature.d.ts.map +1 -1
- package/dist/esm/actions/isSafeSignature.js +3 -3
- package/dist/esm/actions/isSafeSignature.js.map +1 -1
- package/dist/esm/actions/isSafeWallet.d.ts +0 -2
- package/dist/esm/actions/isSafeWallet.d.ts.map +1 -1
- package/dist/esm/actions/isSafeWallet.js +2 -3
- package/dist/esm/actions/isSmartContractWallet.d.ts +0 -2
- package/dist/esm/actions/isSmartContractWallet.d.ts.map +1 -1
- package/dist/esm/actions/isSmartContractWallet.js +1 -2
- package/dist/esm/actions/resolveENSAddress.d.ts +0 -2
- package/dist/esm/actions/resolveENSAddress.d.ts.map +1 -1
- package/dist/esm/actions/resolveENSAddress.js +1 -2
- package/dist/esm/actions/resolveEthereumAddress.d.ts +0 -2
- package/dist/esm/actions/resolveEthereumAddress.d.ts.map +1 -1
- package/dist/esm/actions/resolveEthereumAddress.js +1 -2
- package/dist/esm/actions/resolveTransactionHash.d.ts +0 -2
- package/dist/esm/actions/resolveTransactionHash.d.ts.map +1 -1
- package/dist/esm/actions/resolveTransactionHash.js +7 -4
- package/dist/esm/actions/resolveTransactionHash.js.map +1 -1
- package/dist/esm/actions/resolveUNSAddress.d.ts +0 -2
- package/dist/esm/actions/resolveUNSAddress.d.ts.map +1 -1
- package/dist/esm/actions/resolveUNSAddress.js +2 -3
- package/dist/esm/actions/setAllowance.d.ts +2 -4
- package/dist/esm/actions/setAllowance.d.ts.map +1 -1
- package/dist/esm/actions/setAllowance.js +10 -7
- package/dist/esm/actions/setAllowance.js.map +1 -1
- package/dist/esm/actions/waitForBatchTransactionReceipt.d.ts +0 -2
- package/dist/esm/actions/waitForBatchTransactionReceipt.d.ts.map +1 -1
- package/dist/esm/actions/waitForBatchTransactionReceipt.js +1 -2
- package/dist/esm/actions/waitForRelayedTransactionReceipt.d.ts +1 -3
- package/dist/esm/actions/waitForRelayedTransactionReceipt.d.ts.map +1 -1
- package/dist/esm/actions/waitForRelayedTransactionReceipt.js +51 -13
- package/dist/esm/actions/waitForRelayedTransactionReceipt.js.map +1 -1
- package/dist/esm/actions/waitForSafeTransactionExecution.d.ts +0 -2
- package/dist/esm/actions/waitForSafeTransactionExecution.d.ts.map +1 -1
- package/dist/esm/actions/waitForSafeTransactionExecution.js +2 -3
- package/dist/esm/actions/waitForTransactionReceipt.d.ts +0 -2
- package/dist/esm/actions/waitForTransactionReceipt.d.ts.map +1 -1
- package/dist/esm/actions/waitForTransactionReceipt.js +1 -2
- package/dist/esm/client/publicClient.d.ts +0 -2
- package/dist/esm/client/publicClient.d.ts.map +1 -1
- package/dist/esm/client/publicClient.js +1 -2
- package/dist/esm/client/safeClient.d.ts +0 -2
- package/dist/esm/client/safeClient.d.ts.map +1 -1
- package/dist/esm/client/safeClient.js +1 -2
- package/dist/esm/client/types.d.ts +0 -2
- package/dist/esm/client/types.d.ts.map +1 -1
- package/dist/esm/core/EthereumStepExecutor.d.ts +0 -2
- package/dist/esm/core/EthereumStepExecutor.d.ts.map +1 -1
- package/dist/esm/core/EthereumStepExecutor.js +6 -7
- package/dist/esm/core/EthereumStepExecutor.js.map +1 -1
- package/dist/esm/core/tasks/EthereumBatchedSignAndExecuteTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumBatchedSignAndExecuteTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumBatchedSignAndExecuteTask.js +5 -3
- package/dist/esm/core/tasks/EthereumBatchedSignAndExecuteTask.js.map +1 -1
- package/dist/esm/core/tasks/EthereumBatchedWaitForTransactionTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumBatchedWaitForTransactionTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumBatchedWaitForTransactionTask.js +1 -2
- package/dist/esm/core/tasks/EthereumCheckAllowanceAfterPrepareTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumCheckAllowanceAfterPrepareTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumCheckAllowanceAfterPrepareTask.js +1 -2
- package/dist/esm/core/tasks/EthereumCheckAllowanceAfterPrepareTask.js.map +1 -1
- package/dist/esm/core/tasks/EthereumCheckAllowanceTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumCheckAllowanceTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumCheckAllowanceTask.js +3 -4
- package/dist/esm/core/tasks/EthereumCheckAllowanceTask.js.map +1 -1
- package/dist/esm/core/tasks/EthereumCheckBalanceTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumCheckBalanceTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumCheckBalanceTask.js +4 -4
- package/dist/esm/core/tasks/EthereumCheckBalanceTask.js.map +1 -1
- package/dist/esm/core/tasks/EthereumCheckPermitsTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumCheckPermitsTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumCheckPermitsTask.js +2 -3
- package/dist/esm/core/tasks/EthereumNativePermitTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumNativePermitTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumNativePermitTask.js +5 -6
- package/dist/esm/core/tasks/EthereumNativePermitTask.js.map +1 -1
- package/dist/esm/core/tasks/EthereumPermit2AllowanceTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumPermit2AllowanceTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumPermit2AllowanceTask.js +1 -2
- package/dist/esm/core/tasks/EthereumPrepareTransactionTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumPrepareTransactionTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumPrepareTransactionTask.js +8 -7
- package/dist/esm/core/tasks/EthereumPrepareTransactionTask.js.map +1 -1
- package/dist/esm/core/tasks/EthereumRelayedSignAndExecuteTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumRelayedSignAndExecuteTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumRelayedSignAndExecuteTask.js +3 -4
- package/dist/esm/core/tasks/EthereumRelayedWaitForTransactionTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumRelayedWaitForTransactionTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumRelayedWaitForTransactionTask.js +2 -3
- package/dist/esm/core/tasks/EthereumResetAllowanceTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumResetAllowanceTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumResetAllowanceTask.js +6 -6
- package/dist/esm/core/tasks/EthereumResetAllowanceTask.js.map +1 -1
- package/dist/esm/core/tasks/EthereumSetAllowanceTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumSetAllowanceTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumSetAllowanceTask.js +7 -7
- package/dist/esm/core/tasks/EthereumSetAllowanceTask.js.map +1 -1
- package/dist/esm/core/tasks/EthereumSignAndExecuteTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumSignAndExecuteTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumSignAndExecuteTask.js +2 -3
- package/dist/esm/core/tasks/EthereumStandardSignAndExecuteTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumStandardSignAndExecuteTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumStandardSignAndExecuteTask.js +6 -6
- package/dist/esm/core/tasks/EthereumStandardSignAndExecuteTask.js.map +1 -1
- package/dist/esm/core/tasks/EthereumStandardWaitForTransactionTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumStandardWaitForTransactionTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumStandardWaitForTransactionTask.js +1 -2
- package/dist/esm/core/tasks/EthereumWaitForTransactionStatusTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumWaitForTransactionStatusTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumWaitForTransactionStatusTask.js +1 -2
- package/dist/esm/core/tasks/EthereumWaitForTransactionTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumWaitForTransactionTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumWaitForTransactionTask.js +2 -3
- package/dist/esm/core/tasks/helpers/estimateTransactionRequest.d.ts +1 -3
- package/dist/esm/core/tasks/helpers/estimateTransactionRequest.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/estimateTransactionRequest.js +3 -4
- package/dist/esm/core/tasks/helpers/estimateTransactionRequest.js.map +1 -1
- package/dist/esm/core/tasks/helpers/findSignedNativePermit.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/findSignedNativePermit.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/findSignedNativePermit.js +2 -3
- package/dist/esm/core/tasks/helpers/getApprovalAmount.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/getApprovalAmount.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/getApprovalAmount.js +2 -3
- package/dist/esm/core/tasks/helpers/getEthereumExecutionStrategy.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/getEthereumExecutionStrategy.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/getEthereumExecutionStrategy.js +6 -4
- package/dist/esm/core/tasks/helpers/getEthereumExecutionStrategy.js.map +1 -1
- package/dist/esm/core/tasks/helpers/getTxLink.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/getTxLink.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/getTxLink.js +1 -2
- package/dist/esm/core/tasks/helpers/getUpdatedStep.d.ts +10 -4
- package/dist/esm/core/tasks/helpers/getUpdatedStep.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/getUpdatedStep.js +12 -21
- package/dist/esm/core/tasks/helpers/getUpdatedStep.js.map +1 -1
- package/dist/esm/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.js +1 -2
- package/dist/esm/core/tasks/helpers/hasPermit2AllowanceInFlight.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/hasPermit2AllowanceInFlight.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/hasPermit2AllowanceInFlight.js +1 -2
- package/dist/esm/core/tasks/helpers/isAllowancePreparedForAnotherStrategy.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/isAllowancePreparedForAnotherStrategy.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/isAllowancePreparedForAnotherStrategy.js +1 -2
- package/dist/esm/core/tasks/helpers/isTypedDataAlreadySigned.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/isTypedDataAlreadySigned.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/isTypedDataAlreadySigned.js +1 -2
- package/dist/esm/core/tasks/helpers/preservePermit2Allowances.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/preservePermit2Allowances.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/preservePermit2Allowances.js +1 -2
- package/dist/esm/core/tasks/helpers/resolveAllowanceSpender.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/resolveAllowanceSpender.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/resolveAllowanceSpender.js +1 -2
- package/dist/esm/core/tasks/helpers/resolvePermit2Support.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/resolvePermit2Support.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/resolvePermit2Support.js +1 -2
- package/dist/esm/core/tasks/helpers/shouldCheckForAllowance.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/shouldCheckForAllowance.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/shouldCheckForAllowance.js +3 -3
- package/dist/esm/core/tasks/helpers/shouldCheckForAllowance.js.map +1 -1
- package/dist/esm/core/tasks/helpers/signHyperliquidTypedData.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/signHyperliquidTypedData.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/signHyperliquidTypedData.js +3 -4
- package/dist/esm/core/tasks/helpers/signTypedDataEntries.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/signTypedDataEntries.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/signTypedDataEntries.js +1 -2
- package/dist/esm/core/tasks/helpers/switchChain.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/switchChain.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/switchChain.js +1 -2
- package/dist/esm/core/tasks/helpers/updateActionWithReceipt.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/updateActionWithReceipt.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/updateActionWithReceipt.js +1 -2
- package/dist/esm/errors/parseEthereumErrors.d.ts +0 -2
- package/dist/esm/errors/parseEthereumErrors.d.ts.map +1 -1
- package/dist/esm/errors/parseEthereumErrors.js +4 -4
- package/dist/esm/errors/parseEthereumErrors.js.map +1 -1
- package/dist/esm/hyperliquid/agentWallet.d.ts +0 -2
- package/dist/esm/hyperliquid/agentWallet.d.ts.map +1 -1
- package/dist/esm/hyperliquid/agentWallet.js +1 -2
- package/dist/esm/hyperliquid/isHyperliquidAgentStep.d.ts +0 -2
- package/dist/esm/hyperliquid/isHyperliquidAgentStep.d.ts.map +1 -1
- package/dist/esm/hyperliquid/isHyperliquidAgentStep.js +1 -2
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +8 -8
- package/dist/esm/permits/acceptsRawEcdsaSignature.d.ts +0 -2
- package/dist/esm/permits/acceptsRawEcdsaSignature.d.ts.map +1 -1
- package/dist/esm/permits/acceptsRawEcdsaSignature.js +1 -2
- package/dist/esm/permits/allowanceTransfer.d.ts +0 -2
- package/dist/esm/permits/allowanceTransfer.d.ts.map +1 -1
- package/dist/esm/permits/allowanceTransfer.js +1 -2
- package/dist/esm/permits/allowanceTransfer.js.map +1 -1
- package/dist/esm/permits/canAccountUseNativePermits.d.ts +0 -2
- package/dist/esm/permits/canAccountUseNativePermits.d.ts.map +1 -1
- package/dist/esm/permits/canAccountUseNativePermits.js +1 -2
- package/dist/esm/permits/canAccountUsePermit2.d.ts +0 -2
- package/dist/esm/permits/canAccountUsePermit2.d.ts.map +1 -1
- package/dist/esm/permits/canAccountUsePermit2.js +1 -2
- package/dist/esm/permits/constants.d.ts +0 -2
- package/dist/esm/permits/constants.d.ts.map +1 -1
- package/dist/esm/permits/constants.js +1 -2
- package/dist/esm/permits/domain.d.ts +0 -2
- package/dist/esm/permits/domain.d.ts.map +1 -1
- package/dist/esm/permits/domain.js +1 -2
- package/dist/esm/permits/encodeNativePermitData.d.ts +0 -2
- package/dist/esm/permits/encodeNativePermitData.d.ts.map +1 -1
- package/dist/esm/permits/encodeNativePermitData.js +1 -2
- package/dist/esm/permits/encodePermit2Data.d.ts +0 -2
- package/dist/esm/permits/encodePermit2Data.d.ts.map +1 -1
- package/dist/esm/permits/encodePermit2Data.js +1 -2
- package/dist/esm/permits/getNativePermit.d.ts +0 -2
- package/dist/esm/permits/getNativePermit.d.ts.map +1 -1
- package/dist/esm/permits/getNativePermit.js +7 -8
- package/dist/esm/permits/getNativePermit.js.map +1 -1
- package/dist/esm/permits/getPermitTransferFromValues.d.ts +0 -2
- package/dist/esm/permits/getPermitTransferFromValues.d.ts.map +1 -1
- package/dist/esm/permits/getPermitTransferFromValues.js +2 -3
- package/dist/esm/permits/getPermitTransferFromValues.js.map +1 -1
- package/dist/esm/permits/invariant.d.ts +0 -2
- package/dist/esm/permits/invariant.d.ts.map +1 -1
- package/dist/esm/permits/invariant.js +1 -2
- package/dist/esm/permits/isDelegationDesignatorCode.d.ts +0 -2
- package/dist/esm/permits/isDelegationDesignatorCode.d.ts.map +1 -1
- package/dist/esm/permits/isDelegationDesignatorCode.js +1 -2
- package/dist/esm/permits/isNativePermitValid.d.ts +0 -2
- package/dist/esm/permits/isNativePermitValid.d.ts.map +1 -1
- package/dist/esm/permits/isNativePermitValid.js +2 -3
- package/dist/esm/permits/isNativePermitValid.js.map +1 -1
- package/dist/esm/permits/signPermit2Message.d.ts +0 -2
- package/dist/esm/permits/signPermit2Message.d.ts.map +1 -1
- package/dist/esm/permits/signPermit2Message.js +1 -2
- package/dist/esm/permits/signatureTransfer.d.ts +0 -2
- package/dist/esm/permits/signatureTransfer.d.ts.map +1 -1
- package/dist/esm/permits/signatureTransfer.js +1 -2
- package/dist/esm/permits/types.d.ts +0 -2
- package/dist/esm/permits/types.d.ts.map +1 -1
- package/dist/esm/types.d.ts +6 -2
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/esm/types.js +1 -2
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/utils/abi.d.ts +0 -2
- package/dist/esm/utils/abi.d.ts.map +1 -1
- package/dist/esm/utils/abi.js +1 -2
- package/dist/esm/utils/convertExtendedChain.d.ts +0 -2
- package/dist/esm/utils/convertExtendedChain.d.ts.map +1 -1
- package/dist/esm/utils/convertExtendedChain.js +1 -2
- package/dist/esm/utils/getActionWithFallback.d.ts +2 -3
- package/dist/esm/utils/getActionWithFallback.d.ts.map +1 -1
- package/dist/esm/utils/getActionWithFallback.js +3 -4
- package/dist/esm/utils/getActionWithFallback.js.map +1 -1
- package/dist/esm/utils/getDomainChainId.d.ts +0 -2
- package/dist/esm/utils/getDomainChainId.d.ts.map +1 -1
- package/dist/esm/utils/getDomainChainId.js +1 -2
- package/dist/esm/utils/getSafeApiKey.d.ts +0 -2
- package/dist/esm/utils/getSafeApiKey.d.ts.map +1 -1
- package/dist/esm/utils/getSafeApiKey.js +1 -2
- package/dist/esm/utils/getSendChain.d.ts +3 -0
- package/dist/esm/utils/getSendChain.d.ts.map +1 -0
- package/dist/esm/utils/getSendChain.js +5 -0
- package/dist/esm/utils/getSendChain.js.map +1 -0
- package/dist/esm/utils/getTypedDataLane.d.ts +0 -2
- package/dist/esm/utils/getTypedDataLane.d.ts.map +1 -1
- package/dist/esm/utils/getTypedDataLane.js +1 -2
- package/dist/esm/utils/isContractCallStep.d.ts +0 -2
- package/dist/esm/utils/isContractCallStep.d.ts.map +1 -1
- package/dist/esm/utils/isContractCallStep.js +1 -2
- package/dist/esm/utils/isExtendedChain.d.ts +0 -2
- package/dist/esm/utils/isExtendedChain.d.ts.map +1 -1
- package/dist/esm/utils/isExtendedChain.js +1 -2
- package/dist/esm/utils/isGaslessStep.d.ts +7 -2
- package/dist/esm/utils/isGaslessStep.d.ts.map +1 -1
- package/dist/esm/utils/isGaslessStep.js +8 -2
- package/dist/esm/utils/isGaslessStep.js.map +1 -1
- package/dist/esm/utils/isValidSignature.d.ts +0 -2
- package/dist/esm/utils/isValidSignature.d.ts.map +1 -1
- package/dist/esm/utils/isValidSignature.js +1 -2
- package/dist/esm/utils/isZeroAddress.d.ts +0 -2
- package/dist/esm/utils/isZeroAddress.d.ts.map +1 -1
- package/dist/esm/utils/isZeroAddress.js +1 -2
- package/dist/esm/utils/median.d.ts +0 -2
- package/dist/esm/utils/median.d.ts.map +1 -1
- package/dist/esm/utils/median.js +1 -2
- package/dist/esm/version.d.ts +1 -3
- package/dist/esm/version.d.ts.map +1 -1
- package/dist/esm/version.js +2 -3
- package/dist/esm/version.js.map +1 -1
- package/package.json +3 -3
- package/src/actions/checkPermitSupport.ts +4 -2
- package/src/actions/getAllowance.ts +8 -4
- package/src/actions/getMaxPriorityFeePerGas.ts +4 -2
- package/src/actions/isSafeSignature.ts +3 -3
- package/src/actions/resolveTransactionHash.ts +10 -3
- package/src/actions/setAllowance.ts +31 -6
- package/src/actions/waitForRelayedTransactionReceipt.ts +129 -24
- package/src/core/tasks/EthereumBatchedSignAndExecuteTask.ts +4 -0
- package/src/core/tasks/EthereumCheckAllowanceTask.ts +3 -2
- package/src/core/tasks/EthereumCheckBalanceTask.ts +11 -1
- package/src/core/tasks/EthereumNativePermitTask.ts +2 -1
- package/src/core/tasks/EthereumPrepareTransactionTask.ts +29 -3
- package/src/core/tasks/EthereumResetAllowanceTask.ts +4 -2
- package/src/core/tasks/EthereumSetAllowanceTask.ts +4 -2
- package/src/core/tasks/EthereumStandardSignAndExecuteTask.ts +4 -2
- package/src/core/tasks/helpers/estimateTransactionRequest.ts +4 -2
- package/src/core/tasks/helpers/getEthereumExecutionStrategy.ts +12 -3
- package/src/core/tasks/helpers/getUpdatedStep.ts +26 -25
- package/src/core/tasks/helpers/shouldCheckForAllowance.ts +8 -0
- package/src/errors/parseEthereumErrors.ts +11 -2
- package/src/index.ts +0 -1
- package/src/permits/allowanceTransfer.ts +1 -1
- package/src/permits/getNativePermit.ts +9 -5
- package/src/permits/getPermitTransferFromValues.ts +2 -1
- package/src/permits/isNativePermitValid.ts +1 -1
- package/src/types.ts +7 -2
- package/src/utils/getActionWithFallback.ts +3 -2
- package/src/utils/getSendChain.ts +6 -0
- package/src/utils/isGaslessStep.ts +7 -0
- package/src/version.ts +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_core_tasks_helpers_signTypedDataEntries = require("./helpers/signTypedDataEntries.js");
|
|
3
|
-
const require_permits_isNativePermitValid = require("../../permits/isNativePermitValid.js");
|
|
4
2
|
const require_hyperliquid_isHyperliquidAgentStep = require("../../hyperliquid/isHyperliquidAgentStep.js");
|
|
3
|
+
const require_permits_isNativePermitValid = require("../../permits/isNativePermitValid.js");
|
|
5
4
|
const require_core_tasks_helpers_isTypedDataAlreadySigned = require("./helpers/isTypedDataAlreadySigned.js");
|
|
6
5
|
const require_core_tasks_helpers_signHyperliquidTypedData = require("./helpers/signHyperliquidTypedData.js");
|
|
6
|
+
const require_core_tasks_helpers_signTypedDataEntries = require("./helpers/signTypedDataEntries.js");
|
|
7
7
|
let _lifi_sdk = require("@lifi/sdk");
|
|
8
|
-
|
|
8
|
+
// src/core/tasks/EthereumRelayedSignAndExecuteTask.ts
|
|
9
9
|
var EthereumRelayedSignAndExecuteTask = class extends _lifi_sdk.BaseStepExecutionTask {
|
|
10
10
|
async run(context) {
|
|
11
11
|
const { step, client, statusManager, isBridgeExecution, signedTypedData: currentSignedTypedData } = context;
|
|
@@ -46,7 +46,6 @@ var EthereumRelayedSignAndExecuteTask = class extends _lifi_sdk.BaseStepExecutio
|
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
-
//#endregion
|
|
50
49
|
exports.EthereumRelayedSignAndExecuteTask = EthereumRelayedSignAndExecuteTask;
|
|
51
50
|
|
|
52
51
|
//# sourceMappingURL=EthereumRelayedSignAndExecuteTask.js.map
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
|
-
//#region src/core/tasks/EthereumRelayedWaitForTransactionTask.d.ts
|
|
4
3
|
export declare class EthereumRelayedWaitForTransactionTask extends BaseStepExecutionTask {
|
|
5
4
|
run(context: EthereumStepExecutorContext): Promise<TaskResult>;
|
|
6
|
-
}
|
|
7
|
-
//#endregion
|
|
8
|
-
//# sourceMappingURL=EthereumRelayedWaitForTransactionTask.d.ts.map
|
|
5
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_core_tasks_helpers_updateActionWithReceipt = require("./helpers/updateActionWithReceipt.js");
|
|
3
2
|
const require_actions_waitForRelayedTransactionReceipt = require("../../actions/waitForRelayedTransactionReceipt.js");
|
|
3
|
+
const require_core_tasks_helpers_updateActionWithReceipt = require("./helpers/updateActionWithReceipt.js");
|
|
4
4
|
let _lifi_sdk = require("@lifi/sdk");
|
|
5
|
-
|
|
5
|
+
// src/core/tasks/EthereumRelayedWaitForTransactionTask.ts
|
|
6
6
|
/** The same check as the SDK's internal `isAbortError`. */
|
|
7
7
|
const isAbortError = (error) => typeof error === "object" && error !== null && "name" in error && error.name === "AbortError";
|
|
8
8
|
var EthereumRelayedWaitForTransactionTask = class extends _lifi_sdk.BaseStepExecutionTask {
|
|
@@ -22,7 +22,6 @@ var EthereumRelayedWaitForTransactionTask = class extends _lifi_sdk.BaseStepExec
|
|
|
22
22
|
return { status: "COMPLETED" };
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
//#endregion
|
|
26
25
|
exports.EthereumRelayedWaitForTransactionTask = EthereumRelayedWaitForTransactionTask;
|
|
27
26
|
|
|
28
27
|
//# sourceMappingURL=EthereumRelayedWaitForTransactionTask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumRelayedWaitForTransactionTask.js","names":["BaseStepExecutionTask","TransactionError","LiFiErrorCode","waitForRelayedTransactionReceipt"],"sources":["../../../../src/core/tasks/EthereumRelayedWaitForTransactionTask.ts"],"sourcesContent":["import {\n BaseStepExecutionTask,\n LiFiErrorCode,\n type TaskResult,\n TransactionError,\n} from '@lifi/sdk'\nimport type { Hash } from 'viem'\nimport { waitForRelayedTransactionReceipt } from '../../actions/waitForRelayedTransactionReceipt.js'\nimport type {\n EthereumStepExecutorContext,\n WalletCallReceipt,\n} from '../../types.js'\nimport { updateActionWithReceipt } from './helpers/updateActionWithReceipt.js'\n\n/** The same check as the SDK's internal `isAbortError`. */\nconst isAbortError = (error: unknown): boolean =>\n typeof error === 'object' &&\n error !== null &&\n 'name' in error &&\n error.name === 'AbortError'\n\nexport class EthereumRelayedWaitForTransactionTask extends BaseStepExecutionTask {\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n client,\n step,\n statusManager,\n fromChain,\n isBridgeExecution,\n signal,\n } = context\n\n const action = statusManager.findAction(\n step,\n isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'\n )\n if (!action) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Action not found.'\n )\n }\n\n let transactionReceipt: WalletCallReceipt\n try {\n // The wait starts after the relay request, so it may take the signal of\n // `stopRouteExecution`.\n transactionReceipt = await waitForRelayedTransactionReceipt(\n client,\n action.taskId as Hash,\n step,\n undefined,\n signal\n )\n } catch (error) {\n // `stopRouteExecution` ended the wait; the outcome of the relayed\n // transaction is still unknown. Pause like a stopped step, with no\n // write: the stored action keeps its task id, and a resume waits for it\n // again.\n if (signal?.aborted && isAbortError(error)) {\n return { status: 'PAUSED' }\n }\n throw error\n }\n\n updateActionWithReceipt(\n statusManager,\n step,\n fromChain,\n transactionReceipt,\n action\n )\n\n if (isBridgeExecution) {\n statusManager.updateAction(step, action.type, 'DONE')\n }\n\n return { status: 'COMPLETED' }\n }\n}\n"],"mappings":";;;;;;AAeA,MAAM,gBAAgB,UACpB,OAAO,UAAU,YACjB,UAAU,QACV,UAAU,SACV,MAAM,SAAS;AAEjB,IAAa,wCAAb,cAA2DA,UAAAA,sBAAsB;CAC/E,MAAM,IAAI,SAA2D;EACnE,MAAM,EACJ,QACA,MACA,eACA,WACA,mBACA,WACE;EAEJ,MAAM,SAAS,cAAc,WAC3B,MACA,oBAAoB,gBAAgB,MACtC;EACA,IAAI,CAAC,QACH,MAAM,IAAIC,UAAAA,iBACRC,UAAAA,cAAc,uBACd,kDACF;EAGF,IAAI;EACJ,IAAI;GAGF,qBAAqB,MAAMC,iDAAAA,iCACzB,QACA,OAAO,QACP,MACA,KAAA,GACA,MACF;EACF,SAAS,OAAO;GAKd,IAAI,QAAQ,WAAW,aAAa,KAAK,GACvC,OAAO,EAAE,QAAQ,SAAS;GAE5B,MAAM;EACR;
|
|
1
|
+
{"version":3,"file":"EthereumRelayedWaitForTransactionTask.js","names":["BaseStepExecutionTask","TransactionError","LiFiErrorCode","waitForRelayedTransactionReceipt","updateActionWithReceipt"],"sources":["../../../../src/core/tasks/EthereumRelayedWaitForTransactionTask.ts"],"sourcesContent":["import {\n BaseStepExecutionTask,\n LiFiErrorCode,\n type TaskResult,\n TransactionError,\n} from '@lifi/sdk'\nimport type { Hash } from 'viem'\nimport { waitForRelayedTransactionReceipt } from '../../actions/waitForRelayedTransactionReceipt.js'\nimport type {\n EthereumStepExecutorContext,\n WalletCallReceipt,\n} from '../../types.js'\nimport { updateActionWithReceipt } from './helpers/updateActionWithReceipt.js'\n\n/** The same check as the SDK's internal `isAbortError`. */\nconst isAbortError = (error: unknown): boolean =>\n typeof error === 'object' &&\n error !== null &&\n 'name' in error &&\n error.name === 'AbortError'\n\nexport class EthereumRelayedWaitForTransactionTask extends BaseStepExecutionTask {\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n client,\n step,\n statusManager,\n fromChain,\n isBridgeExecution,\n signal,\n } = context\n\n const action = statusManager.findAction(\n step,\n isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'\n )\n if (!action) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Action not found.'\n )\n }\n\n let transactionReceipt: WalletCallReceipt\n try {\n // The wait starts after the relay request, so it may take the signal of\n // `stopRouteExecution`.\n transactionReceipt = await waitForRelayedTransactionReceipt(\n client,\n action.taskId as Hash,\n step,\n undefined,\n signal\n )\n } catch (error) {\n // `stopRouteExecution` ended the wait; the outcome of the relayed\n // transaction is still unknown. Pause like a stopped step, with no\n // write: the stored action keeps its task id, and a resume waits for it\n // again.\n if (signal?.aborted && isAbortError(error)) {\n return { status: 'PAUSED' }\n }\n throw error\n }\n\n updateActionWithReceipt(\n statusManager,\n step,\n fromChain,\n transactionReceipt,\n action\n )\n\n if (isBridgeExecution) {\n statusManager.updateAction(step, action.type, 'DONE')\n }\n\n return { status: 'COMPLETED' }\n }\n}\n"],"mappings":";;;;;;AAeA,MAAM,gBAAgB,UACpB,OAAO,UAAU,YACjB,UAAU,QACV,UAAU,SACV,MAAM,SAAS;AAEjB,IAAa,wCAAb,cAA2DA,UAAAA,sBAAsB;CAC/E,MAAM,IAAI,SAA2D;EACnE,MAAM,EACJ,QACA,MACA,eACA,WACA,mBACA,WACE;EAEJ,MAAM,SAAS,cAAc,WAC3B,MACA,oBAAoB,gBAAgB,MACtC;EACA,IAAI,CAAC,QACH,MAAM,IAAIC,UAAAA,iBACRC,UAAAA,cAAc,uBACd,kDACF;EAGF,IAAI;EACJ,IAAI;GAGF,qBAAqB,MAAMC,iDAAAA,iCACzB,QACA,OAAO,QACP,MACA,KAAA,GACA,MACF;EACF,SAAS,OAAO;GAKd,IAAI,QAAQ,WAAW,aAAa,KAAK,GACvC,OAAO,EAAE,QAAQ,SAAS;GAE5B,MAAM;EACR;EAEAC,mDAAAA,wBACE,eACA,MACA,WACA,oBACA,MACF;EAEA,IAAI,mBACF,cAAc,aAAa,MAAM,OAAO,MAAM,MAAM;EAGtD,OAAO,EAAE,QAAQ,YAAY;CAC/B;AACF"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
|
-
//#region src/core/tasks/EthereumResetAllowanceTask.d.ts
|
|
4
3
|
export declare class EthereumResetAllowanceTask extends BaseStepExecutionTask {
|
|
5
4
|
override shouldRun(context: EthereumStepExecutorContext): Promise<boolean>;
|
|
6
5
|
run(context: EthereumStepExecutorContext): Promise<TaskResult>;
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
9
|
-
//# sourceMappingURL=EthereumResetAllowanceTask.d.ts.map
|
|
6
|
+
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_core_tasks_helpers_getEthereumExecutionStrategy = require("./helpers/getEthereumExecutionStrategy.js");
|
|
3
|
-
const require_core_tasks_helpers_resolveAllowanceSpender = require("./helpers/resolveAllowanceSpender.js");
|
|
4
2
|
const require_actions_resolveTransactionHash = require("../../actions/resolveTransactionHash.js");
|
|
5
3
|
const require_actions_setAllowance = require("../../actions/setAllowance.js");
|
|
6
4
|
const require_actions_waitForTransactionReceipt = require("../../actions/waitForTransactionReceipt.js");
|
|
5
|
+
const require_utils_convertExtendedChain = require("../../utils/convertExtendedChain.js");
|
|
6
|
+
const require_core_tasks_helpers_getEthereumExecutionStrategy = require("./helpers/getEthereumExecutionStrategy.js");
|
|
7
7
|
const require_core_tasks_helpers_getTxLink = require("./helpers/getTxLink.js");
|
|
8
|
+
const require_core_tasks_helpers_resolveAllowanceSpender = require("./helpers/resolveAllowanceSpender.js");
|
|
8
9
|
let _lifi_sdk = require("@lifi/sdk");
|
|
9
|
-
|
|
10
|
+
// src/core/tasks/EthereumResetAllowanceTask.ts
|
|
10
11
|
var EthereumResetAllowanceTask = class extends _lifi_sdk.BaseStepExecutionTask {
|
|
11
12
|
async shouldRun(context) {
|
|
12
13
|
const { step, hasMatchingPermit, hasSufficientAllowance, hasAllowance } = context;
|
|
@@ -30,7 +31,7 @@ var EthereumResetAllowanceTask = class extends _lifi_sdk.BaseStepExecutionTask {
|
|
|
30
31
|
const { spenderAddress } = await require_core_tasks_helpers_resolveAllowanceSpender.resolveAllowanceSpender(context, executionStrategy);
|
|
31
32
|
const updatedClient = await checkClient(step);
|
|
32
33
|
if (!updatedClient) return { status: "PAUSED" };
|
|
33
|
-
const resetResult = await require_actions_setAllowance.setAllowance(client, updatedClient, step.action.fromToken.address, spenderAddress, 0n, executionOptions, batchingSupported);
|
|
34
|
+
const resetResult = await require_actions_setAllowance.setAllowance(client, updatedClient, step.action.fromToken.address, spenderAddress, 0n, executionOptions, batchingSupported, require_utils_convertExtendedChain.convertExtendedChain(fromChain));
|
|
34
35
|
const calls = [...currentCalls];
|
|
35
36
|
if (batchingSupported) calls.push({
|
|
36
37
|
to: step.action.fromToken.address,
|
|
@@ -46,7 +47,7 @@ var EthereumResetAllowanceTask = class extends _lifi_sdk.BaseStepExecutionTask {
|
|
|
46
47
|
const finalHash = (await require_actions_waitForTransactionReceipt.waitForTransactionReceipt(client, {
|
|
47
48
|
client: updatedClient,
|
|
48
49
|
chainId: fromChain.id,
|
|
49
|
-
txHash:
|
|
50
|
+
txHash: resolvedTxHash,
|
|
50
51
|
onReplaced(response) {
|
|
51
52
|
const newHash = response.transaction.hash;
|
|
52
53
|
statusManager.updateAction(step, action.type, "PENDING", {
|
|
@@ -70,7 +71,6 @@ var EthereumResetAllowanceTask = class extends _lifi_sdk.BaseStepExecutionTask {
|
|
|
70
71
|
};
|
|
71
72
|
}
|
|
72
73
|
};
|
|
73
|
-
//#endregion
|
|
74
74
|
exports.EthereumResetAllowanceTask = EthereumResetAllowanceTask;
|
|
75
75
|
|
|
76
76
|
//# sourceMappingURL=EthereumResetAllowanceTask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumResetAllowanceTask.js","names":["BaseStepExecutionTask","getEthereumExecutionStrategy","resolveAllowanceSpender","setAllowance","resolveTransactionHash","getTxLink","waitForTransactionReceipt"],"sources":["../../../../src/core/tasks/EthereumResetAllowanceTask.ts"],"sourcesContent":["import { BaseStepExecutionTask, type TaskResult } from '@lifi/sdk'\nimport type { Address } from 'viem'\nimport { resolveTransactionHash } from '../../actions/resolveTransactionHash.js'\nimport { setAllowance } from '../../actions/setAllowance.js'\nimport { waitForTransactionReceipt } from '../../actions/waitForTransactionReceipt.js'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { getEthereumExecutionStrategy } from './helpers/getEthereumExecutionStrategy.js'\nimport { getTxLink } from './helpers/getTxLink.js'\nimport { resolveAllowanceSpender } from './helpers/resolveAllowanceSpender.js'\n\nexport class EthereumResetAllowanceTask extends BaseStepExecutionTask {\n override async shouldRun(\n context: EthereumStepExecutorContext\n ): Promise<boolean> {\n const { step, hasMatchingPermit, hasSufficientAllowance, hasAllowance } =\n context\n\n return (\n !hasMatchingPermit &&\n !hasSufficientAllowance &&\n !!step.estimate.approvalReset &&\n !!hasAllowance\n )\n }\n\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n step,\n statusManager,\n allowUserInteraction,\n checkClient,\n fromChain,\n executionOptions,\n client,\n calls: currentCalls,\n } = context\n\n const action = statusManager.initializeAction({\n step,\n type: 'RESET_ALLOWANCE',\n chainId: step.action.fromChainId,\n status: 'STARTED',\n })\n\n statusManager.updateAction(step, action.type, 'RESET_REQUIRED', {\n txHash: undefined,\n txLink: undefined,\n })\n\n if (!allowUserInteraction) {\n return { status: 'PAUSED' }\n }\n\n const executionStrategy = await getEthereumExecutionStrategy(context)\n const batchingSupported = executionStrategy === 'batched'\n const { spenderAddress } = await resolveAllowanceSpender(\n context,\n executionStrategy\n )\n\n const updatedClient = await checkClient(step)\n if (!updatedClient) {\n return { status: 'PAUSED' }\n }\n\n // Reset allowance to 0 if required\n const resetResult = await setAllowance(\n client,\n updatedClient,\n step.action.fromToken.address as Address,\n spenderAddress,\n 0n,\n executionOptions,\n batchingSupported\n )\n\n const calls = [...currentCalls]\n if (batchingSupported) {\n calls.push({\n to: step.action.fromToken.address as Address,\n data: resetResult,\n chainId: step.action.fromToken.chainId,\n })\n } else {\n const resolvedTxHash = await resolveTransactionHash(\n client,\n updatedClient,\n resetResult,\n fromChain.id\n )\n statusManager.updateAction(step, action.type, 'PENDING', {\n txHash: resolvedTxHash,\n txLink: getTxLink(fromChain, resolvedTxHash),\n })\n\n const transactionReceipt = await waitForTransactionReceipt(client, {\n client: updatedClient,\n chainId: fromChain.id,\n txHash:
|
|
1
|
+
{"version":3,"file":"EthereumResetAllowanceTask.js","names":["BaseStepExecutionTask","getEthereumExecutionStrategy","resolveAllowanceSpender","setAllowance","convertExtendedChain","resolveTransactionHash","getTxLink","waitForTransactionReceipt"],"sources":["../../../../src/core/tasks/EthereumResetAllowanceTask.ts"],"sourcesContent":["import { BaseStepExecutionTask, type TaskResult } from '@lifi/sdk'\nimport type { Address } from 'viem'\nimport { resolveTransactionHash } from '../../actions/resolveTransactionHash.js'\nimport { setAllowance } from '../../actions/setAllowance.js'\nimport { waitForTransactionReceipt } from '../../actions/waitForTransactionReceipt.js'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { convertExtendedChain } from '../../utils/convertExtendedChain.js'\nimport { getEthereumExecutionStrategy } from './helpers/getEthereumExecutionStrategy.js'\nimport { getTxLink } from './helpers/getTxLink.js'\nimport { resolveAllowanceSpender } from './helpers/resolveAllowanceSpender.js'\n\nexport class EthereumResetAllowanceTask extends BaseStepExecutionTask {\n override async shouldRun(\n context: EthereumStepExecutorContext\n ): Promise<boolean> {\n const { step, hasMatchingPermit, hasSufficientAllowance, hasAllowance } =\n context\n\n return (\n !hasMatchingPermit &&\n !hasSufficientAllowance &&\n !!step.estimate.approvalReset &&\n !!hasAllowance\n )\n }\n\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n step,\n statusManager,\n allowUserInteraction,\n checkClient,\n fromChain,\n executionOptions,\n client,\n calls: currentCalls,\n } = context\n\n const action = statusManager.initializeAction({\n step,\n type: 'RESET_ALLOWANCE',\n chainId: step.action.fromChainId,\n status: 'STARTED',\n })\n\n statusManager.updateAction(step, action.type, 'RESET_REQUIRED', {\n txHash: undefined,\n txLink: undefined,\n })\n\n if (!allowUserInteraction) {\n return { status: 'PAUSED' }\n }\n\n const executionStrategy = await getEthereumExecutionStrategy(context)\n const batchingSupported = executionStrategy === 'batched'\n const { spenderAddress } = await resolveAllowanceSpender(\n context,\n executionStrategy\n )\n\n const updatedClient = await checkClient(step)\n if (!updatedClient) {\n return { status: 'PAUSED' }\n }\n\n // Reset allowance to 0 if required\n const resetResult = await setAllowance(\n client,\n updatedClient,\n step.action.fromToken.address as Address,\n spenderAddress,\n 0n,\n executionOptions,\n batchingSupported,\n convertExtendedChain(fromChain)\n )\n\n const calls = [...currentCalls]\n if (batchingSupported) {\n calls.push({\n to: step.action.fromToken.address as Address,\n data: resetResult,\n chainId: step.action.fromToken.chainId,\n })\n } else {\n const resolvedTxHash = await resolveTransactionHash(\n client,\n updatedClient,\n resetResult,\n fromChain.id\n )\n statusManager.updateAction(step, action.type, 'PENDING', {\n txHash: resolvedTxHash,\n txLink: getTxLink(fromChain, resolvedTxHash),\n })\n\n const transactionReceipt = await waitForTransactionReceipt(client, {\n client: updatedClient,\n chainId: fromChain.id,\n txHash: resolvedTxHash,\n onReplaced(response) {\n const newHash = response.transaction.hash\n statusManager.updateAction(step, action.type, 'PENDING', {\n txHash: newHash,\n txLink: getTxLink(fromChain, newHash),\n })\n },\n })\n\n const finalHash = transactionReceipt?.transactionHash || resolvedTxHash\n statusManager.updateAction(step, action.type, 'PENDING', {\n txHash: finalHash,\n txLink: getTxLink(fromChain, finalHash),\n })\n }\n\n statusManager.updateAction(step, action.type, 'DONE')\n\n return {\n status: 'COMPLETED',\n context: { calls, executionStrategy },\n }\n }\n}\n"],"mappings":";;;;;;;;;;AAWA,IAAa,6BAAb,cAAgDA,UAAAA,sBAAsB;CACpE,MAAe,UACb,SACkB;EAClB,MAAM,EAAE,MAAM,mBAAmB,wBAAwB,iBACvD;EAEF,OACE,CAAC,qBACD,CAAC,0BACD,CAAC,CAAC,KAAK,SAAS,iBAChB,CAAC,CAAC;CAEN;CAEA,MAAM,IAAI,SAA2D;EACnE,MAAM,EACJ,MACA,eACA,sBACA,aACA,WACA,kBACA,QACA,OAAO,iBACL;EAEJ,MAAM,SAAS,cAAc,iBAAiB;GAC5C;GACA,MAAM;GACN,SAAS,KAAK,OAAO;GACrB,QAAQ;EACV,CAAC;EAED,cAAc,aAAa,MAAM,OAAO,MAAM,kBAAkB;GAC9D,QAAQ,KAAA;GACR,QAAQ,KAAA;EACV,CAAC;EAED,IAAI,CAAC,sBACH,OAAO,EAAE,QAAQ,SAAS;EAG5B,MAAM,oBAAoB,MAAMC,wDAAAA,6BAA6B,OAAO;EACpE,MAAM,oBAAoB,sBAAsB;EAChD,MAAM,EAAE,mBAAmB,MAAMC,mDAAAA,wBAC/B,SACA,iBACF;EAEA,MAAM,gBAAgB,MAAM,YAAY,IAAI;EAC5C,IAAI,CAAC,eACH,OAAO,EAAE,QAAQ,SAAS;EAI5B,MAAM,cAAc,MAAMC,6BAAAA,aACxB,QACA,eACA,KAAK,OAAO,UAAU,SACtB,gBACA,IACA,kBACA,mBACAC,mCAAAA,qBAAqB,SAAS,CAChC;EAEA,MAAM,QAAQ,CAAC,GAAG,YAAY;EAC9B,IAAI,mBACF,MAAM,KAAK;GACT,IAAI,KAAK,OAAO,UAAU;GAC1B,MAAM;GACN,SAAS,KAAK,OAAO,UAAU;EACjC,CAAC;OACI;GACL,MAAM,iBAAiB,MAAMC,uCAAAA,uBAC3B,QACA,eACA,aACA,UAAU,EACZ;GACA,cAAc,aAAa,MAAM,OAAO,MAAM,WAAW;IACvD,QAAQ;IACR,QAAQC,qCAAAA,UAAU,WAAW,cAAc;GAC7C,CAAC;GAeD,MAAM,aAAY,MAbeC,0CAAAA,0BAA0B,QAAQ;IACjE,QAAQ;IACR,SAAS,UAAU;IACnB,QAAQ;IACR,WAAW,UAAU;KACnB,MAAM,UAAU,SAAS,YAAY;KACrC,cAAc,aAAa,MAAM,OAAO,MAAM,WAAW;MACvD,QAAQ;MACR,QAAQD,qCAAAA,UAAU,WAAW,OAAO;KACtC,CAAC;IACH;GACF,CAAC,EAAA,EAEqC,mBAAmB;GACzD,cAAc,aAAa,MAAM,OAAO,MAAM,WAAW;IACvD,QAAQ;IACR,QAAQA,qCAAAA,UAAU,WAAW,SAAS;GACxC,CAAC;EACH;EAEA,cAAc,aAAa,MAAM,OAAO,MAAM,MAAM;EAEpD,OAAO;GACL,QAAQ;GACR,SAAS;IAAE;IAAO;GAAkB;EACtC;CACF;AACF"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
|
-
//#region src/core/tasks/EthereumSetAllowanceTask.d.ts
|
|
4
3
|
export declare class EthereumSetAllowanceTask extends BaseStepExecutionTask {
|
|
5
4
|
override shouldRun(context: EthereumStepExecutorContext): Promise<boolean>;
|
|
6
5
|
run(context: EthereumStepExecutorContext): Promise<TaskResult>;
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
9
|
-
//# sourceMappingURL=EthereumSetAllowanceTask.d.ts.map
|
|
6
|
+
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_core_tasks_helpers_getEthereumExecutionStrategy = require("./helpers/getEthereumExecutionStrategy.js");
|
|
3
|
-
const require_core_tasks_helpers_resolveAllowanceSpender = require("./helpers/resolveAllowanceSpender.js");
|
|
4
2
|
const require_actions_resolveTransactionHash = require("../../actions/resolveTransactionHash.js");
|
|
5
3
|
const require_actions_setAllowance = require("../../actions/setAllowance.js");
|
|
6
4
|
const require_actions_waitForTransactionReceipt = require("../../actions/waitForTransactionReceipt.js");
|
|
7
|
-
const
|
|
5
|
+
const require_utils_convertExtendedChain = require("../../utils/convertExtendedChain.js");
|
|
8
6
|
const require_core_tasks_helpers_getApprovalAmount = require("./helpers/getApprovalAmount.js");
|
|
7
|
+
const require_core_tasks_helpers_getEthereumExecutionStrategy = require("./helpers/getEthereumExecutionStrategy.js");
|
|
8
|
+
const require_core_tasks_helpers_getTxLink = require("./helpers/getTxLink.js");
|
|
9
|
+
const require_core_tasks_helpers_resolveAllowanceSpender = require("./helpers/resolveAllowanceSpender.js");
|
|
9
10
|
let _lifi_sdk = require("@lifi/sdk");
|
|
10
|
-
|
|
11
|
+
// src/core/tasks/EthereumSetAllowanceTask.ts
|
|
11
12
|
var EthereumSetAllowanceTask = class extends _lifi_sdk.BaseStepExecutionTask {
|
|
12
13
|
async shouldRun(context) {
|
|
13
14
|
return !context.hasMatchingPermit && !context.hasSufficientAllowance;
|
|
@@ -31,7 +32,7 @@ var EthereumSetAllowanceTask = class extends _lifi_sdk.BaseStepExecutionTask {
|
|
|
31
32
|
const approveAmount = require_core_tasks_helpers_getApprovalAmount.getApprovalAmount(context, permit2Supported);
|
|
32
33
|
const updatedClient = await checkClient(step);
|
|
33
34
|
if (!updatedClient) return { status: "PAUSED" };
|
|
34
|
-
const approveResult = await require_actions_setAllowance.setAllowance(client, updatedClient, step.action.fromToken.address, spenderAddress, approveAmount, executionOptions, batchingSupported);
|
|
35
|
+
const approveResult = await require_actions_setAllowance.setAllowance(client, updatedClient, step.action.fromToken.address, spenderAddress, approveAmount, executionOptions, batchingSupported, require_utils_convertExtendedChain.convertExtendedChain(fromChain));
|
|
35
36
|
const calls = [...currentCalls];
|
|
36
37
|
if (batchingSupported) {
|
|
37
38
|
calls.push({
|
|
@@ -49,7 +50,7 @@ var EthereumSetAllowanceTask = class extends _lifi_sdk.BaseStepExecutionTask {
|
|
|
49
50
|
const finalHash = (await require_actions_waitForTransactionReceipt.waitForTransactionReceipt(client, {
|
|
50
51
|
client: updatedClient,
|
|
51
52
|
chainId: fromChain.id,
|
|
52
|
-
txHash:
|
|
53
|
+
txHash: resolvedTxHash,
|
|
53
54
|
onReplaced(response) {
|
|
54
55
|
const newHash = response.transaction.hash;
|
|
55
56
|
statusManager.updateAction(step, action.type, "PENDING", {
|
|
@@ -72,7 +73,6 @@ var EthereumSetAllowanceTask = class extends _lifi_sdk.BaseStepExecutionTask {
|
|
|
72
73
|
};
|
|
73
74
|
}
|
|
74
75
|
};
|
|
75
|
-
//#endregion
|
|
76
76
|
exports.EthereumSetAllowanceTask = EthereumSetAllowanceTask;
|
|
77
77
|
|
|
78
78
|
//# sourceMappingURL=EthereumSetAllowanceTask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumSetAllowanceTask.js","names":["BaseStepExecutionTask","getEthereumExecutionStrategy","resolveAllowanceSpender","getApprovalAmount","setAllowance","resolveTransactionHash","getTxLink","waitForTransactionReceipt"],"sources":["../../../../src/core/tasks/EthereumSetAllowanceTask.ts"],"sourcesContent":["import { BaseStepExecutionTask, type TaskResult } from '@lifi/sdk'\nimport type { Address } from 'viem'\nimport { resolveTransactionHash } from '../../actions/resolveTransactionHash.js'\nimport { setAllowance } from '../../actions/setAllowance.js'\nimport { waitForTransactionReceipt } from '../../actions/waitForTransactionReceipt.js'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { getApprovalAmount } from './helpers/getApprovalAmount.js'\nimport { getEthereumExecutionStrategy } from './helpers/getEthereumExecutionStrategy.js'\nimport { getTxLink } from './helpers/getTxLink.js'\nimport { resolveAllowanceSpender } from './helpers/resolveAllowanceSpender.js'\n\nexport class EthereumSetAllowanceTask extends BaseStepExecutionTask {\n override async shouldRun(\n context: EthereumStepExecutorContext\n ): Promise<boolean> {\n return !context.hasMatchingPermit && !context.hasSufficientAllowance\n }\n\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n step,\n client,\n statusManager,\n executionOptions,\n fromChain,\n allowUserInteraction,\n checkClient,\n calls: currentCalls,\n } = context\n\n const action = statusManager.initializeAction({\n step,\n type: 'SET_ALLOWANCE',\n chainId: step.action.fromChainId,\n status: 'STARTED',\n })\n\n // Clear the txHash and txLink from potential previous approval transaction\n statusManager.updateAction(step, action.type, 'ACTION_REQUIRED', {\n txHash: undefined,\n txLink: undefined,\n })\n\n if (!allowUserInteraction) {\n return { status: 'PAUSED' }\n }\n\n const executionStrategy = await getEthereumExecutionStrategy(context)\n const batchingSupported = executionStrategy === 'batched'\n // Check if chain has Permit2 contract deployed. Permit2 should not be available for atomic batch.\n const { permit2Supported, spenderAddress } = await resolveAllowanceSpender(\n context,\n executionStrategy\n )\n\n // Set new allowance\n const approveAmount = getApprovalAmount(context, permit2Supported)\n\n const updatedClient = await checkClient(step)\n if (!updatedClient) {\n return { status: 'PAUSED' }\n }\n\n const approveResult = await setAllowance(\n client,\n updatedClient,\n step.action.fromToken.address as Address,\n spenderAddress,\n approveAmount,\n executionOptions,\n // We need to return the populated transaction when batching is supported\n // instead of executing transaction on-chain\n batchingSupported\n )\n\n const calls = [...currentCalls]\n if (batchingSupported) {\n calls.push({\n to: step.action.fromToken.address as Address,\n data: approveResult,\n chainId: step.action.fromToken.chainId,\n })\n\n statusManager.updateAction(step, action.type, 'DONE')\n } else {\n const resolvedTxHash = await resolveTransactionHash(\n client,\n updatedClient,\n approveResult,\n fromChain.id\n )\n statusManager.updateAction(step, action.type, 'PENDING', {\n txHash: resolvedTxHash,\n txLink: getTxLink(fromChain, resolvedTxHash),\n })\n\n const transactionReceipt = await waitForTransactionReceipt(client, {\n client: updatedClient,\n chainId: fromChain.id,\n txHash:
|
|
1
|
+
{"version":3,"file":"EthereumSetAllowanceTask.js","names":["BaseStepExecutionTask","getEthereumExecutionStrategy","resolveAllowanceSpender","getApprovalAmount","setAllowance","convertExtendedChain","resolveTransactionHash","getTxLink","waitForTransactionReceipt"],"sources":["../../../../src/core/tasks/EthereumSetAllowanceTask.ts"],"sourcesContent":["import { BaseStepExecutionTask, type TaskResult } from '@lifi/sdk'\nimport type { Address } from 'viem'\nimport { resolveTransactionHash } from '../../actions/resolveTransactionHash.js'\nimport { setAllowance } from '../../actions/setAllowance.js'\nimport { waitForTransactionReceipt } from '../../actions/waitForTransactionReceipt.js'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { convertExtendedChain } from '../../utils/convertExtendedChain.js'\nimport { getApprovalAmount } from './helpers/getApprovalAmount.js'\nimport { getEthereumExecutionStrategy } from './helpers/getEthereumExecutionStrategy.js'\nimport { getTxLink } from './helpers/getTxLink.js'\nimport { resolveAllowanceSpender } from './helpers/resolveAllowanceSpender.js'\n\nexport class EthereumSetAllowanceTask extends BaseStepExecutionTask {\n override async shouldRun(\n context: EthereumStepExecutorContext\n ): Promise<boolean> {\n return !context.hasMatchingPermit && !context.hasSufficientAllowance\n }\n\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n step,\n client,\n statusManager,\n executionOptions,\n fromChain,\n allowUserInteraction,\n checkClient,\n calls: currentCalls,\n } = context\n\n const action = statusManager.initializeAction({\n step,\n type: 'SET_ALLOWANCE',\n chainId: step.action.fromChainId,\n status: 'STARTED',\n })\n\n // Clear the txHash and txLink from potential previous approval transaction\n statusManager.updateAction(step, action.type, 'ACTION_REQUIRED', {\n txHash: undefined,\n txLink: undefined,\n })\n\n if (!allowUserInteraction) {\n return { status: 'PAUSED' }\n }\n\n const executionStrategy = await getEthereumExecutionStrategy(context)\n const batchingSupported = executionStrategy === 'batched'\n // Check if chain has Permit2 contract deployed. Permit2 should not be available for atomic batch.\n const { permit2Supported, spenderAddress } = await resolveAllowanceSpender(\n context,\n executionStrategy\n )\n\n // Set new allowance\n const approveAmount = getApprovalAmount(context, permit2Supported)\n\n const updatedClient = await checkClient(step)\n if (!updatedClient) {\n return { status: 'PAUSED' }\n }\n\n const approveResult = await setAllowance(\n client,\n updatedClient,\n step.action.fromToken.address as Address,\n spenderAddress,\n approveAmount,\n executionOptions,\n // We need to return the populated transaction when batching is supported\n // instead of executing transaction on-chain\n batchingSupported,\n convertExtendedChain(fromChain)\n )\n\n const calls = [...currentCalls]\n if (batchingSupported) {\n calls.push({\n to: step.action.fromToken.address as Address,\n data: approveResult,\n chainId: step.action.fromToken.chainId,\n })\n\n statusManager.updateAction(step, action.type, 'DONE')\n } else {\n const resolvedTxHash = await resolveTransactionHash(\n client,\n updatedClient,\n approveResult,\n fromChain.id\n )\n statusManager.updateAction(step, action.type, 'PENDING', {\n txHash: resolvedTxHash,\n txLink: getTxLink(fromChain, resolvedTxHash),\n })\n\n const transactionReceipt = await waitForTransactionReceipt(client, {\n client: updatedClient,\n chainId: fromChain.id,\n txHash: resolvedTxHash,\n onReplaced(response) {\n const newHash = response.transaction.hash\n statusManager.updateAction(step, action.type, 'PENDING', {\n txHash: newHash,\n txLink: getTxLink(fromChain, newHash),\n })\n },\n })\n\n const finalHash = transactionReceipt?.transactionHash || resolvedTxHash\n statusManager.updateAction(step, action.type, 'DONE', {\n txHash: finalHash,\n txLink: getTxLink(fromChain, finalHash),\n })\n }\n\n return {\n status: 'COMPLETED',\n context: { calls, executionStrategy },\n }\n }\n}\n"],"mappings":";;;;;;;;;;;AAYA,IAAa,2BAAb,cAA8CA,UAAAA,sBAAsB;CAClE,MAAe,UACb,SACkB;EAClB,OAAO,CAAC,QAAQ,qBAAqB,CAAC,QAAQ;CAChD;CAEA,MAAM,IAAI,SAA2D;EACnE,MAAM,EACJ,MACA,QACA,eACA,kBACA,WACA,sBACA,aACA,OAAO,iBACL;EAEJ,MAAM,SAAS,cAAc,iBAAiB;GAC5C;GACA,MAAM;GACN,SAAS,KAAK,OAAO;GACrB,QAAQ;EACV,CAAC;EAGD,cAAc,aAAa,MAAM,OAAO,MAAM,mBAAmB;GAC/D,QAAQ,KAAA;GACR,QAAQ,KAAA;EACV,CAAC;EAED,IAAI,CAAC,sBACH,OAAO,EAAE,QAAQ,SAAS;EAG5B,MAAM,oBAAoB,MAAMC,wDAAAA,6BAA6B,OAAO;EACpE,MAAM,oBAAoB,sBAAsB;EAEhD,MAAM,EAAE,kBAAkB,mBAAmB,MAAMC,mDAAAA,wBACjD,SACA,iBACF;EAGA,MAAM,gBAAgBC,6CAAAA,kBAAkB,SAAS,gBAAgB;EAEjE,MAAM,gBAAgB,MAAM,YAAY,IAAI;EAC5C,IAAI,CAAC,eACH,OAAO,EAAE,QAAQ,SAAS;EAG5B,MAAM,gBAAgB,MAAMC,6BAAAA,aAC1B,QACA,eACA,KAAK,OAAO,UAAU,SACtB,gBACA,eACA,kBAGA,mBACAC,mCAAAA,qBAAqB,SAAS,CAChC;EAEA,MAAM,QAAQ,CAAC,GAAG,YAAY;EAC9B,IAAI,mBAAmB;GACrB,MAAM,KAAK;IACT,IAAI,KAAK,OAAO,UAAU;IAC1B,MAAM;IACN,SAAS,KAAK,OAAO,UAAU;GACjC,CAAC;GAED,cAAc,aAAa,MAAM,OAAO,MAAM,MAAM;EACtD,OAAO;GACL,MAAM,iBAAiB,MAAMC,uCAAAA,uBAC3B,QACA,eACA,eACA,UAAU,EACZ;GACA,cAAc,aAAa,MAAM,OAAO,MAAM,WAAW;IACvD,QAAQ;IACR,QAAQC,qCAAAA,UAAU,WAAW,cAAc;GAC7C,CAAC;GAeD,MAAM,aAAY,MAbeC,0CAAAA,0BAA0B,QAAQ;IACjE,QAAQ;IACR,SAAS,UAAU;IACnB,QAAQ;IACR,WAAW,UAAU;KACnB,MAAM,UAAU,SAAS,YAAY;KACrC,cAAc,aAAa,MAAM,OAAO,MAAM,WAAW;MACvD,QAAQ;MACR,QAAQD,qCAAAA,UAAU,WAAW,OAAO;KACtC,CAAC;IACH;GACF,CAAC,EAAA,EAEqC,mBAAmB;GACzD,cAAc,aAAa,MAAM,OAAO,MAAM,QAAQ;IACpD,QAAQ;IACR,QAAQA,qCAAAA,UAAU,WAAW,SAAS;GACxC,CAAC;EACH;EAEA,OAAO;GACL,QAAQ;GACR,SAAS;IAAE;IAAO;GAAkB;EACtC;CACF;AACF"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
|
-
//#region src/core/tasks/EthereumSignAndExecuteTask.d.ts
|
|
4
3
|
export declare class EthereumSignAndExecuteTask extends BaseStepExecutionTask {
|
|
5
4
|
run(context: EthereumStepExecutorContext): Promise<TaskResult>;
|
|
6
|
-
}
|
|
7
|
-
//#endregion
|
|
8
|
-
//# sourceMappingURL=EthereumSignAndExecuteTask.d.ts.map
|
|
5
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_core_tasks_helpers_getEthereumExecutionStrategy = require("./helpers/getEthereumExecutionStrategy.js");
|
|
3
2
|
const require_core_tasks_EthereumBatchedSignAndExecuteTask = require("./EthereumBatchedSignAndExecuteTask.js");
|
|
4
3
|
const require_core_tasks_EthereumRelayedSignAndExecuteTask = require("./EthereumRelayedSignAndExecuteTask.js");
|
|
5
4
|
const require_core_tasks_EthereumStandardSignAndExecuteTask = require("./EthereumStandardSignAndExecuteTask.js");
|
|
5
|
+
const require_core_tasks_helpers_getEthereumExecutionStrategy = require("./helpers/getEthereumExecutionStrategy.js");
|
|
6
6
|
let _lifi_sdk = require("@lifi/sdk");
|
|
7
|
-
|
|
7
|
+
// src/core/tasks/EthereumSignAndExecuteTask.ts
|
|
8
8
|
var EthereumSignAndExecuteTask = class extends _lifi_sdk.BaseStepExecutionTask {
|
|
9
9
|
async run(context) {
|
|
10
10
|
const { step, statusManager, allowUserInteraction, transactionRequest, isBridgeExecution } = context;
|
|
@@ -19,7 +19,6 @@ var EthereumSignAndExecuteTask = class extends _lifi_sdk.BaseStepExecutionTask {
|
|
|
19
19
|
return new require_core_tasks_EthereumStandardSignAndExecuteTask.EthereumStandardSignAndExecuteTask().run(context);
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
//#endregion
|
|
23
22
|
exports.EthereumSignAndExecuteTask = EthereumSignAndExecuteTask;
|
|
24
23
|
|
|
25
24
|
//# sourceMappingURL=EthereumSignAndExecuteTask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumSignAndExecuteTask.js","names":["BaseStepExecutionTask","TransactionError","LiFiErrorCode","getEthereumExecutionStrategy","EthereumBatchedSignAndExecuteTask","EthereumRelayedSignAndExecuteTask","EthereumStandardSignAndExecuteTask"],"sources":["../../../../src/core/tasks/EthereumSignAndExecuteTask.ts"],"sourcesContent":["import {\n assertNoOpenTransaction,\n BaseStepExecutionTask,\n LiFiErrorCode,\n type TaskResult,\n TransactionError,\n} from '@lifi/sdk'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { EthereumBatchedSignAndExecuteTask } from './EthereumBatchedSignAndExecuteTask.js'\nimport { EthereumRelayedSignAndExecuteTask } from './EthereumRelayedSignAndExecuteTask.js'\nimport { EthereumStandardSignAndExecuteTask } from './EthereumStandardSignAndExecuteTask.js'\nimport { getEthereumExecutionStrategy } from './helpers/getEthereumExecutionStrategy.js'\n\nexport class EthereumSignAndExecuteTask extends BaseStepExecutionTask {\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n step,\n statusManager,\n allowUserInteraction,\n transactionRequest,\n isBridgeExecution,\n } = context\n\n const action = statusManager.findAction(\n step,\n isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'\n )\n if (!action) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Action not found.'\n )\n }\n\n // Defence in depth for every lane below: the selector never routes an open\n // transaction here, and signing again could execute the swap twice.\n assertNoOpenTransaction(action)\n\n statusManager.updateAction(step, action.type, 'ACTION_REQUIRED')\n\n if (!allowUserInteraction) {\n return { status: 'PAUSED' }\n }\n\n const executionStrategy = await getEthereumExecutionStrategy(context)\n if (executionStrategy === 'batched' && transactionRequest) {\n return new EthereumBatchedSignAndExecuteTask().run(context)\n }\n if (executionStrategy === 'relayed') {\n return new EthereumRelayedSignAndExecuteTask().run(context)\n }\n return new EthereumStandardSignAndExecuteTask().run(context)\n }\n}\n"],"mappings":";;;;;;;AAaA,IAAa,6BAAb,cAAgDA,UAAAA,sBAAsB;CACpE,MAAM,IAAI,SAA2D;EACnE,MAAM,EACJ,MACA,eACA,sBACA,oBACA,sBACE;EAEJ,MAAM,SAAS,cAAc,WAC3B,MACA,oBAAoB,gBAAgB,MACtC;EACA,IAAI,CAAC,QACH,MAAM,IAAIC,UAAAA,iBACRC,UAAAA,cAAc,uBACd,kDACF;
|
|
1
|
+
{"version":3,"file":"EthereumSignAndExecuteTask.js","names":["BaseStepExecutionTask","TransactionError","LiFiErrorCode","assertNoOpenTransaction","getEthereumExecutionStrategy","EthereumBatchedSignAndExecuteTask","EthereumRelayedSignAndExecuteTask","EthereumStandardSignAndExecuteTask"],"sources":["../../../../src/core/tasks/EthereumSignAndExecuteTask.ts"],"sourcesContent":["import {\n assertNoOpenTransaction,\n BaseStepExecutionTask,\n LiFiErrorCode,\n type TaskResult,\n TransactionError,\n} from '@lifi/sdk'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { EthereumBatchedSignAndExecuteTask } from './EthereumBatchedSignAndExecuteTask.js'\nimport { EthereumRelayedSignAndExecuteTask } from './EthereumRelayedSignAndExecuteTask.js'\nimport { EthereumStandardSignAndExecuteTask } from './EthereumStandardSignAndExecuteTask.js'\nimport { getEthereumExecutionStrategy } from './helpers/getEthereumExecutionStrategy.js'\n\nexport class EthereumSignAndExecuteTask extends BaseStepExecutionTask {\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n step,\n statusManager,\n allowUserInteraction,\n transactionRequest,\n isBridgeExecution,\n } = context\n\n const action = statusManager.findAction(\n step,\n isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'\n )\n if (!action) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Action not found.'\n )\n }\n\n // Defence in depth for every lane below: the selector never routes an open\n // transaction here, and signing again could execute the swap twice.\n assertNoOpenTransaction(action)\n\n statusManager.updateAction(step, action.type, 'ACTION_REQUIRED')\n\n if (!allowUserInteraction) {\n return { status: 'PAUSED' }\n }\n\n const executionStrategy = await getEthereumExecutionStrategy(context)\n if (executionStrategy === 'batched' && transactionRequest) {\n return new EthereumBatchedSignAndExecuteTask().run(context)\n }\n if (executionStrategy === 'relayed') {\n return new EthereumRelayedSignAndExecuteTask().run(context)\n }\n return new EthereumStandardSignAndExecuteTask().run(context)\n }\n}\n"],"mappings":";;;;;;;AAaA,IAAa,6BAAb,cAAgDA,UAAAA,sBAAsB;CACpE,MAAM,IAAI,SAA2D;EACnE,MAAM,EACJ,MACA,eACA,sBACA,oBACA,sBACE;EAEJ,MAAM,SAAS,cAAc,WAC3B,MACA,oBAAoB,gBAAgB,MACtC;EACA,IAAI,CAAC,QACH,MAAM,IAAIC,UAAAA,iBACRC,UAAAA,cAAc,uBACd,kDACF;EAKFC,CAAAA,GAAAA,UAAAA,wBAAAA,CAAwB,MAAM;EAE9B,cAAc,aAAa,MAAM,OAAO,MAAM,iBAAiB;EAE/D,IAAI,CAAC,sBACH,OAAO,EAAE,QAAQ,SAAS;EAG5B,MAAM,oBAAoB,MAAMC,wDAAAA,6BAA6B,OAAO;EACpE,IAAI,sBAAsB,aAAa,oBACrC,OAAO,IAAIC,qDAAAA,kCAAkC,CAAC,CAAC,IAAI,OAAO;EAE5D,IAAI,sBAAsB,WACxB,OAAO,IAAIC,qDAAAA,kCAAkC,CAAC,CAAC,IAAI,OAAO;EAE5D,OAAO,IAAIC,sDAAAA,mCAAmC,CAAC,CAAC,IAAI,OAAO;CAC7D;AACF"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
|
-
//#region src/core/tasks/EthereumStandardSignAndExecuteTask.d.ts
|
|
4
3
|
export declare class EthereumStandardSignAndExecuteTask extends BaseStepExecutionTask {
|
|
5
4
|
run(context: EthereumStepExecutorContext): Promise<TaskResult>;
|
|
6
|
-
}
|
|
7
|
-
//#endregion
|
|
8
|
-
//# sourceMappingURL=EthereumStandardSignAndExecuteTask.d.ts.map
|
|
5
|
+
}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_core_tasks_helpers_resolvePermit2Support = require("./helpers/resolvePermit2Support.js");
|
|
3
2
|
const require_actions_resolveTransactionHash = require("../../actions/resolveTransactionHash.js");
|
|
4
|
-
const require_core_tasks_helpers_getTxLink = require("./helpers/getTxLink.js");
|
|
5
3
|
const require_permits_encodeNativePermitData = require("../../permits/encodeNativePermitData.js");
|
|
6
4
|
const require_permits_encodePermit2Data = require("../../permits/encodePermit2Data.js");
|
|
7
5
|
const require_permits_signPermit2Message = require("../../permits/signPermit2Message.js");
|
|
8
6
|
const require_utils_convertExtendedChain = require("../../utils/convertExtendedChain.js");
|
|
7
|
+
const require_utils_getSendChain = require("../../utils/getSendChain.js");
|
|
9
8
|
const require_core_tasks_helpers_estimateTransactionRequest = require("./helpers/estimateTransactionRequest.js");
|
|
10
9
|
const require_core_tasks_helpers_findSignedNativePermit = require("./helpers/findSignedNativePermit.js");
|
|
10
|
+
const require_core_tasks_helpers_getTxLink = require("./helpers/getTxLink.js");
|
|
11
|
+
const require_core_tasks_helpers_resolvePermit2Support = require("./helpers/resolvePermit2Support.js");
|
|
11
12
|
let _lifi_sdk = require("@lifi/sdk");
|
|
12
13
|
let viem_actions = require("viem/actions");
|
|
13
14
|
let viem_utils = require("viem/utils");
|
|
14
|
-
|
|
15
|
+
// src/core/tasks/EthereumStandardSignAndExecuteTask.ts
|
|
15
16
|
var EthereumStandardSignAndExecuteTask = class extends _lifi_sdk.BaseStepExecutionTask {
|
|
16
17
|
async run(context) {
|
|
17
18
|
const { step, client, fromChain, statusManager, checkClient, transactionRequest, allowUserInteraction, isBridgeExecution } = context;
|
|
@@ -43,7 +44,7 @@ var EthereumStandardSignAndExecuteTask = class extends _lifi_sdk.BaseStepExecuti
|
|
|
43
44
|
...transactionRequest,
|
|
44
45
|
to: fromChain.permit2Proxy
|
|
45
46
|
};
|
|
46
|
-
finalTransactionRequest = await require_core_tasks_helpers_estimateTransactionRequest.estimateTransactionRequest(client, updatedClient, finalTransactionRequest);
|
|
47
|
+
finalTransactionRequest = await require_core_tasks_helpers_estimateTransactionRequest.estimateTransactionRequest(client, updatedClient, finalTransactionRequest, fromChain.id);
|
|
47
48
|
}
|
|
48
49
|
(0, _lifi_sdk.assertNoOpenTransaction)(statusManager.findAction(step, action.type));
|
|
49
50
|
const txHash = await (0, viem_utils.getAction)(updatedClient, viem_actions.sendTransaction, "sendTransaction")({
|
|
@@ -55,7 +56,7 @@ var EthereumStandardSignAndExecuteTask = class extends _lifi_sdk.BaseStepExecuti
|
|
|
55
56
|
gasPrice: finalTransactionRequest.gasPrice,
|
|
56
57
|
maxFeePerGas: finalTransactionRequest.maxFeePerGas,
|
|
57
58
|
maxPriorityFeePerGas: finalTransactionRequest.maxPriorityFeePerGas,
|
|
58
|
-
chain: require_utils_convertExtendedChain.convertExtendedChain(fromChain)
|
|
59
|
+
chain: require_utils_getSendChain.getSendChain(updatedClient, require_utils_convertExtendedChain.convertExtendedChain(fromChain))
|
|
59
60
|
});
|
|
60
61
|
const resolvedTxHash = await require_actions_resolveTransactionHash.resolveTransactionHash(client, updatedClient, txHash, fromChain.id);
|
|
61
62
|
statusManager.updateAction(step, action.type, "PENDING", {
|
|
@@ -71,7 +72,6 @@ var EthereumStandardSignAndExecuteTask = class extends _lifi_sdk.BaseStepExecuti
|
|
|
71
72
|
};
|
|
72
73
|
}
|
|
73
74
|
};
|
|
74
|
-
//#endregion
|
|
75
75
|
exports.EthereumStandardSignAndExecuteTask = EthereumStandardSignAndExecuteTask;
|
|
76
76
|
|
|
77
77
|
//# sourceMappingURL=EthereumStandardSignAndExecuteTask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumStandardSignAndExecuteTask.js","names":["BaseStepExecutionTask","TransactionError","LiFiErrorCode","findSignedNativePermit","resolvePermit2Support","encodeNativePermitData","signPermit2Message","encodePermit2Data","estimateTransactionRequest","getAction","sendTransaction","convertExtendedChain","resolveTransactionHash","CLEARED_TRANSACTION_FIELDS","getTxLink"],"sources":["../../../../src/core/tasks/EthereumStandardSignAndExecuteTask.ts"],"sourcesContent":["import {\n assertNoOpenTransaction,\n BaseStepExecutionTask,\n CLEARED_TRANSACTION_FIELDS,\n LiFiErrorCode,\n type TaskResult,\n TransactionError,\n} from '@lifi/sdk'\nimport type { Address, Hex, SendTransactionParameters } from 'viem'\nimport { sendTransaction } from 'viem/actions'\nimport { getAction } from 'viem/utils'\nimport { resolveTransactionHash } from '../../actions/resolveTransactionHash.js'\nimport { encodeNativePermitData } from '../../permits/encodeNativePermitData.js'\nimport { encodePermit2Data } from '../../permits/encodePermit2Data.js'\nimport { signPermit2Message } from '../../permits/signPermit2Message.js'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { convertExtendedChain } from '../../utils/convertExtendedChain.js'\nimport { estimateTransactionRequest } from './helpers/estimateTransactionRequest.js'\nimport { findSignedNativePermit } from './helpers/findSignedNativePermit.js'\nimport { getTxLink } from './helpers/getTxLink.js'\nimport { resolvePermit2Support } from './helpers/resolvePermit2Support.js'\n\nexport class EthereumStandardSignAndExecuteTask extends BaseStepExecutionTask {\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n step,\n client,\n fromChain,\n statusManager,\n checkClient,\n transactionRequest,\n allowUserInteraction,\n isBridgeExecution,\n } = context\n\n if (!transactionRequest) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Transaction request is not found.'\n )\n }\n\n const action = statusManager.findAction(\n step,\n isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'\n )\n if (!action) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Action not found.'\n )\n }\n\n // Make sure that the chain is still correct\n const updatedClient = await checkClient(step)\n if (!updatedClient) {\n return { status: 'PAUSED' }\n }\n\n const signedNativePermitTypedData = findSignedNativePermit(context)\n // Resolved *after* the native-permit lookup, and short-circuited when one\n // is found: a matching permit always wins, so resolving the gate first\n // would spend an `eth_getCode` on a verdict this task never reads. The\n // ternary also makes the two routes explicitly exclusive.\n const permit2Supported = signedNativePermitTypedData\n ? false\n : await resolvePermit2Support(context, 'standard')\n if (signedNativePermitTypedData) {\n transactionRequest.data = encodeNativePermitData(\n step.action.fromToken.address as Address,\n BigInt(step.action.fromAmount),\n signedNativePermitTypedData.message.deadline,\n signedNativePermitTypedData.signature,\n transactionRequest.data as Hex\n )\n } else if (permit2Supported) {\n statusManager.updateAction(step, action.type, 'MESSAGE_REQUIRED')\n if (!allowUserInteraction) {\n return { status: 'PAUSED' }\n }\n const permit2Signature = await signPermit2Message(client, {\n client: updatedClient,\n chain: fromChain,\n tokenAddress: step.action.fromToken.address as Address,\n amount: BigInt(step.action.fromAmount),\n data: transactionRequest.data as Hex,\n })\n transactionRequest.data = encodePermit2Data(\n step.action.fromToken.address as Address,\n BigInt(step.action.fromAmount),\n permit2Signature.message.nonce,\n permit2Signature.message.deadline,\n transactionRequest.data as Hex,\n permit2Signature.signature\n )\n statusManager.updateAction(step, action.type, 'ACTION_REQUIRED')\n if (!allowUserInteraction) {\n return { status: 'PAUSED' }\n }\n }\n\n let finalTransactionRequest = transactionRequest\n if (signedNativePermitTypedData || permit2Supported) {\n // Target address should be the Permit2 proxy contract in case of native permit or Permit2\n finalTransactionRequest = {\n ...transactionRequest,\n to: fromChain.permit2Proxy as Address,\n }\n finalTransactionRequest = await estimateTransactionRequest(\n client,\n updatedClient,\n finalTransactionRequest\n )\n }\n\n // Checked again right before the wallet: a late write of an older run\n // can merge its transaction into this action during the awaits above\n // (strategy, chain switch, permit prompt, gas estimate).\n assertNoOpenTransaction(statusManager.findAction(step, action.type))\n\n const txHash = await getAction(\n updatedClient,\n sendTransaction,\n 'sendTransaction'\n )({\n to: finalTransactionRequest.to as Address,\n account: updatedClient.account!,\n data: finalTransactionRequest.data as Hex,\n value: finalTransactionRequest.value,\n gas: finalTransactionRequest.gas,\n gasPrice: finalTransactionRequest.gasPrice,\n maxFeePerGas: finalTransactionRequest.maxFeePerGas,\n maxPriorityFeePerGas: finalTransactionRequest.maxPriorityFeePerGas,\n chain: convertExtendedChain(fromChain),\n } as SendTransactionParameters)\n\n const resolvedTxHash = await resolveTransactionHash(\n client,\n updatedClient,\n txHash,\n fromChain.id\n )\n\n statusManager.updateAction(step, action.type, 'PENDING', {\n // A new transaction: nothing of the previous one may survive, least of\n // all its `txFinal` verdict.\n ...CLEARED_TRANSACTION_FIELDS,\n txHash: resolvedTxHash,\n txLink: getTxLink(fromChain, resolvedTxHash),\n txType: 'standard',\n signedAt: Date.now(),\n })\n\n return {\n status: 'COMPLETED',\n context: {\n transactionRequest: finalTransactionRequest,\n },\n }\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthereumStandardSignAndExecuteTask.js","names":["BaseStepExecutionTask","TransactionError","LiFiErrorCode","findSignedNativePermit","resolvePermit2Support","encodeNativePermitData","signPermit2Message","encodePermit2Data","estimateTransactionRequest","assertNoOpenTransaction","getAction","sendTransaction","getSendChain","convertExtendedChain","resolveTransactionHash","CLEARED_TRANSACTION_FIELDS","getTxLink"],"sources":["../../../../src/core/tasks/EthereumStandardSignAndExecuteTask.ts"],"sourcesContent":["import {\n assertNoOpenTransaction,\n BaseStepExecutionTask,\n CLEARED_TRANSACTION_FIELDS,\n LiFiErrorCode,\n type TaskResult,\n TransactionError,\n} from '@lifi/sdk'\nimport type { Address, Hex, SendTransactionParameters } from 'viem'\nimport { sendTransaction } from 'viem/actions'\nimport { getAction } from 'viem/utils'\nimport { resolveTransactionHash } from '../../actions/resolveTransactionHash.js'\nimport { encodeNativePermitData } from '../../permits/encodeNativePermitData.js'\nimport { encodePermit2Data } from '../../permits/encodePermit2Data.js'\nimport { signPermit2Message } from '../../permits/signPermit2Message.js'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { convertExtendedChain } from '../../utils/convertExtendedChain.js'\nimport { getSendChain } from '../../utils/getSendChain.js'\nimport { estimateTransactionRequest } from './helpers/estimateTransactionRequest.js'\nimport { findSignedNativePermit } from './helpers/findSignedNativePermit.js'\nimport { getTxLink } from './helpers/getTxLink.js'\nimport { resolvePermit2Support } from './helpers/resolvePermit2Support.js'\n\nexport class EthereumStandardSignAndExecuteTask extends BaseStepExecutionTask {\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n step,\n client,\n fromChain,\n statusManager,\n checkClient,\n transactionRequest,\n allowUserInteraction,\n isBridgeExecution,\n } = context\n\n if (!transactionRequest) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Transaction request is not found.'\n )\n }\n\n const action = statusManager.findAction(\n step,\n isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'\n )\n if (!action) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Action not found.'\n )\n }\n\n // Make sure that the chain is still correct\n const updatedClient = await checkClient(step)\n if (!updatedClient) {\n return { status: 'PAUSED' }\n }\n\n const signedNativePermitTypedData = findSignedNativePermit(context)\n // Resolved *after* the native-permit lookup, and short-circuited when one\n // is found: a matching permit always wins, so resolving the gate first\n // would spend an `eth_getCode` on a verdict this task never reads. The\n // ternary also makes the two routes explicitly exclusive.\n const permit2Supported = signedNativePermitTypedData\n ? false\n : await resolvePermit2Support(context, 'standard')\n if (signedNativePermitTypedData) {\n transactionRequest.data = encodeNativePermitData(\n step.action.fromToken.address as Address,\n BigInt(step.action.fromAmount),\n signedNativePermitTypedData.message.deadline,\n signedNativePermitTypedData.signature,\n transactionRequest.data as Hex\n )\n } else if (permit2Supported) {\n statusManager.updateAction(step, action.type, 'MESSAGE_REQUIRED')\n if (!allowUserInteraction) {\n return { status: 'PAUSED' }\n }\n const permit2Signature = await signPermit2Message(client, {\n client: updatedClient,\n chain: fromChain,\n tokenAddress: step.action.fromToken.address as Address,\n amount: BigInt(step.action.fromAmount),\n data: transactionRequest.data as Hex,\n })\n transactionRequest.data = encodePermit2Data(\n step.action.fromToken.address as Address,\n BigInt(step.action.fromAmount),\n permit2Signature.message.nonce,\n permit2Signature.message.deadline,\n transactionRequest.data as Hex,\n permit2Signature.signature\n )\n statusManager.updateAction(step, action.type, 'ACTION_REQUIRED')\n if (!allowUserInteraction) {\n return { status: 'PAUSED' }\n }\n }\n\n let finalTransactionRequest = transactionRequest\n if (signedNativePermitTypedData || permit2Supported) {\n // Target address should be the Permit2 proxy contract in case of native permit or Permit2\n finalTransactionRequest = {\n ...transactionRequest,\n to: fromChain.permit2Proxy as Address,\n }\n finalTransactionRequest = await estimateTransactionRequest(\n client,\n updatedClient,\n finalTransactionRequest,\n fromChain.id\n )\n }\n\n // Checked again right before the wallet: a late write of an older run\n // can merge its transaction into this action during the awaits above\n // (strategy, chain switch, permit prompt, gas estimate).\n assertNoOpenTransaction(statusManager.findAction(step, action.type))\n\n const txHash = await getAction(\n updatedClient,\n sendTransaction,\n 'sendTransaction'\n )({\n to: finalTransactionRequest.to as Address,\n account: updatedClient.account!,\n data: finalTransactionRequest.data as Hex,\n value: finalTransactionRequest.value,\n gas: finalTransactionRequest.gas,\n gasPrice: finalTransactionRequest.gasPrice,\n maxFeePerGas: finalTransactionRequest.maxFeePerGas,\n maxPriorityFeePerGas: finalTransactionRequest.maxPriorityFeePerGas,\n chain: getSendChain(updatedClient, convertExtendedChain(fromChain)),\n } as SendTransactionParameters)\n\n const resolvedTxHash = await resolveTransactionHash(\n client,\n updatedClient,\n txHash,\n fromChain.id\n )\n\n statusManager.updateAction(step, action.type, 'PENDING', {\n // A new transaction: nothing of the previous one may survive, least of\n // all its `txFinal` verdict.\n ...CLEARED_TRANSACTION_FIELDS,\n txHash: resolvedTxHash,\n txLink: getTxLink(fromChain, resolvedTxHash),\n txType: 'standard',\n signedAt: Date.now(),\n })\n\n return {\n status: 'COMPLETED',\n context: {\n transactionRequest: finalTransactionRequest,\n },\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAuBA,IAAa,qCAAb,cAAwDA,UAAAA,sBAAsB;CAC5E,MAAM,IAAI,SAA2D;EACnE,MAAM,EACJ,MACA,QACA,WACA,eACA,aACA,oBACA,sBACA,sBACE;EAEJ,IAAI,CAAC,oBACH,MAAM,IAAIC,UAAAA,iBACRC,UAAAA,cAAc,uBACd,kEACF;EAGF,MAAM,SAAS,cAAc,WAC3B,MACA,oBAAoB,gBAAgB,MACtC;EACA,IAAI,CAAC,QACH,MAAM,IAAID,UAAAA,iBACRC,UAAAA,cAAc,uBACd,kDACF;EAIF,MAAM,gBAAgB,MAAM,YAAY,IAAI;EAC5C,IAAI,CAAC,eACH,OAAO,EAAE,QAAQ,SAAS;EAG5B,MAAM,8BAA8BC,kDAAAA,uBAAuB,OAAO;EAKlE,MAAM,mBAAmB,8BACrB,QACA,MAAMC,iDAAAA,sBAAsB,SAAS,UAAU;EACnD,IAAI,6BACF,mBAAmB,OAAOC,uCAAAA,uBACxB,KAAK,OAAO,UAAU,SACtB,OAAO,KAAK,OAAO,UAAU,GAC7B,4BAA4B,QAAQ,UACpC,4BAA4B,WAC5B,mBAAmB,IACrB;OACK,IAAI,kBAAkB;GAC3B,cAAc,aAAa,MAAM,OAAO,MAAM,kBAAkB;GAChE,IAAI,CAAC,sBACH,OAAO,EAAE,QAAQ,SAAS;GAE5B,MAAM,mBAAmB,MAAMC,mCAAAA,mBAAmB,QAAQ;IACxD,QAAQ;IACR,OAAO;IACP,cAAc,KAAK,OAAO,UAAU;IACpC,QAAQ,OAAO,KAAK,OAAO,UAAU;IACrC,MAAM,mBAAmB;GAC3B,CAAC;GACD,mBAAmB,OAAOC,kCAAAA,kBACxB,KAAK,OAAO,UAAU,SACtB,OAAO,KAAK,OAAO,UAAU,GAC7B,iBAAiB,QAAQ,OACzB,iBAAiB,QAAQ,UACzB,mBAAmB,MACnB,iBAAiB,SACnB;GACA,cAAc,aAAa,MAAM,OAAO,MAAM,iBAAiB;GAC/D,IAAI,CAAC,sBACH,OAAO,EAAE,QAAQ,SAAS;EAE9B;EAEA,IAAI,0BAA0B;EAC9B,IAAI,+BAA+B,kBAAkB;GAEnD,0BAA0B;IACxB,GAAG;IACH,IAAI,UAAU;GAChB;GACA,0BAA0B,MAAMC,sDAAAA,2BAC9B,QACA,eACA,yBACA,UAAU,EACZ;EACF;EAKAC,CAAAA,GAAAA,UAAAA,wBAAAA,CAAwB,cAAc,WAAW,MAAM,OAAO,IAAI,CAAC;EAEnE,MAAM,SAAS,OAAA,GAAMC,WAAAA,UAAAA,CACnB,eACAC,aAAAA,iBACA,iBACF,CAAC,CAAC;GACA,IAAI,wBAAwB;GAC5B,SAAS,cAAc;GACvB,MAAM,wBAAwB;GAC9B,OAAO,wBAAwB;GAC/B,KAAK,wBAAwB;GAC7B,UAAU,wBAAwB;GAClC,cAAc,wBAAwB;GACtC,sBAAsB,wBAAwB;GAC9C,OAAOC,2BAAAA,aAAa,eAAeC,mCAAAA,qBAAqB,SAAS,CAAC;EACpE,CAA8B;EAE9B,MAAM,iBAAiB,MAAMC,uCAAAA,uBAC3B,QACA,eACA,QACA,UAAU,EACZ;EAEA,cAAc,aAAa,MAAM,OAAO,MAAM,WAAW;GAGvD,GAAGC,UAAAA;GACH,QAAQ;GACR,QAAQC,qCAAAA,UAAU,WAAW,cAAc;GAC3C,QAAQ;GACR,UAAU,KAAK,IAAI;EACrB,CAAC;EAED,OAAO;GACL,QAAQ;GACR,SAAS,EACP,oBAAoB,wBACtB;EACF;CACF;AACF"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
|
-
//#region src/core/tasks/EthereumStandardWaitForTransactionTask.d.ts
|
|
4
3
|
export declare class EthereumStandardWaitForTransactionTask extends BaseStepExecutionTask {
|
|
5
4
|
run(context: EthereumStepExecutorContext): Promise<TaskResult>;
|
|
6
|
-
}
|
|
7
|
-
//#endregion
|
|
8
|
-
//# sourceMappingURL=EthereumStandardWaitForTransactionTask.d.ts.map
|
|
5
|
+
}
|
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_actions_waitForTransactionReceipt = require("../../actions/waitForTransactionReceipt.js");
|
|
3
3
|
const require_core_tasks_helpers_updateActionWithReceipt = require("./helpers/updateActionWithReceipt.js");
|
|
4
4
|
let _lifi_sdk = require("@lifi/sdk");
|
|
5
|
-
|
|
5
|
+
// src/core/tasks/EthereumStandardWaitForTransactionTask.ts
|
|
6
6
|
var EthereumStandardWaitForTransactionTask = class extends _lifi_sdk.BaseStepExecutionTask {
|
|
7
7
|
async run(context) {
|
|
8
8
|
const { client, step, statusManager, fromChain, isBridgeExecution, checkClient } = context;
|
|
@@ -26,7 +26,6 @@ var EthereumStandardWaitForTransactionTask = class extends _lifi_sdk.BaseStepExe
|
|
|
26
26
|
return { status: "COMPLETED" };
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
-
//#endregion
|
|
30
29
|
exports.EthereumStandardWaitForTransactionTask = EthereumStandardWaitForTransactionTask;
|
|
31
30
|
|
|
32
31
|
//# sourceMappingURL=EthereumStandardWaitForTransactionTask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumStandardWaitForTransactionTask.js","names":["BaseStepExecutionTask","TransactionError","LiFiErrorCode","waitForTransactionReceipt"],"sources":["../../../../src/core/tasks/EthereumStandardWaitForTransactionTask.ts"],"sourcesContent":["import {\n BaseStepExecutionTask,\n LiFiErrorCode,\n type TaskResult,\n TransactionError,\n} from '@lifi/sdk'\nimport type { Hash } from 'viem'\nimport { waitForTransactionReceipt } from '../../actions/waitForTransactionReceipt.js'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { updateActionWithReceipt } from './helpers/updateActionWithReceipt.js'\n\nexport class EthereumStandardWaitForTransactionTask extends BaseStepExecutionTask {\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n client,\n step,\n statusManager,\n fromChain,\n isBridgeExecution,\n checkClient,\n } = context\n\n const action = statusManager.findAction(\n step,\n isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'\n )\n if (!action) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Action not found.'\n )\n }\n\n const updatedClient = await checkClient(step)\n if (!updatedClient) {\n return { status: 'PAUSED' }\n }\n\n const transactionReceipt = await waitForTransactionReceipt(client, {\n client: updatedClient,\n chainId: fromChain.id,\n txHash: action.txHash as Hash,\n onReplaced: (response) => {\n statusManager.updateAction(step, action.type, 'PENDING', {\n txHash: response.transaction.hash,\n txLink: `${fromChain.metamask.blockExplorerUrls[0]}tx/${response.transaction.hash}`,\n })\n },\n })\n\n updateActionWithReceipt(\n statusManager,\n step,\n fromChain,\n transactionReceipt,\n action\n )\n\n if (isBridgeExecution) {\n statusManager.updateAction(step, action.type, 'DONE')\n }\n\n return { status: 'COMPLETED' }\n }\n}\n"],"mappings":";;;;;AAWA,IAAa,yCAAb,cAA4DA,UAAAA,sBAAsB;CAChF,MAAM,IAAI,SAA2D;EACnE,MAAM,EACJ,QACA,MACA,eACA,WACA,mBACA,gBACE;EAEJ,MAAM,SAAS,cAAc,WAC3B,MACA,oBAAoB,gBAAgB,MACtC;EACA,IAAI,CAAC,QACH,MAAM,IAAIC,UAAAA,iBACRC,UAAAA,cAAc,uBACd,kDACF;EAGF,MAAM,gBAAgB,MAAM,YAAY,IAAI;EAC5C,IAAI,CAAC,eACH,OAAO,EAAE,QAAQ,SAAS;EAG5B,MAAM,qBAAqB,MAAMC,0CAAAA,0BAA0B,QAAQ;GACjE,QAAQ;GACR,SAAS,UAAU;GACnB,QAAQ,OAAO;GACf,aAAa,aAAa;IACxB,cAAc,aAAa,MAAM,OAAO,MAAM,WAAW;KACvD,QAAQ,SAAS,YAAY;KAC7B,QAAQ,GAAG,UAAU,SAAS,kBAAkB,GAAG,KAAK,SAAS,YAAY;IAC/E,CAAC;GACH;EACF,CAAC;
|
|
1
|
+
{"version":3,"file":"EthereumStandardWaitForTransactionTask.js","names":["BaseStepExecutionTask","TransactionError","LiFiErrorCode","waitForTransactionReceipt","updateActionWithReceipt"],"sources":["../../../../src/core/tasks/EthereumStandardWaitForTransactionTask.ts"],"sourcesContent":["import {\n BaseStepExecutionTask,\n LiFiErrorCode,\n type TaskResult,\n TransactionError,\n} from '@lifi/sdk'\nimport type { Hash } from 'viem'\nimport { waitForTransactionReceipt } from '../../actions/waitForTransactionReceipt.js'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { updateActionWithReceipt } from './helpers/updateActionWithReceipt.js'\n\nexport class EthereumStandardWaitForTransactionTask extends BaseStepExecutionTask {\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n client,\n step,\n statusManager,\n fromChain,\n isBridgeExecution,\n checkClient,\n } = context\n\n const action = statusManager.findAction(\n step,\n isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'\n )\n if (!action) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Action not found.'\n )\n }\n\n const updatedClient = await checkClient(step)\n if (!updatedClient) {\n return { status: 'PAUSED' }\n }\n\n const transactionReceipt = await waitForTransactionReceipt(client, {\n client: updatedClient,\n chainId: fromChain.id,\n txHash: action.txHash as Hash,\n onReplaced: (response) => {\n statusManager.updateAction(step, action.type, 'PENDING', {\n txHash: response.transaction.hash,\n txLink: `${fromChain.metamask.blockExplorerUrls[0]}tx/${response.transaction.hash}`,\n })\n },\n })\n\n updateActionWithReceipt(\n statusManager,\n step,\n fromChain,\n transactionReceipt,\n action\n )\n\n if (isBridgeExecution) {\n statusManager.updateAction(step, action.type, 'DONE')\n }\n\n return { status: 'COMPLETED' }\n }\n}\n"],"mappings":";;;;;AAWA,IAAa,yCAAb,cAA4DA,UAAAA,sBAAsB;CAChF,MAAM,IAAI,SAA2D;EACnE,MAAM,EACJ,QACA,MACA,eACA,WACA,mBACA,gBACE;EAEJ,MAAM,SAAS,cAAc,WAC3B,MACA,oBAAoB,gBAAgB,MACtC;EACA,IAAI,CAAC,QACH,MAAM,IAAIC,UAAAA,iBACRC,UAAAA,cAAc,uBACd,kDACF;EAGF,MAAM,gBAAgB,MAAM,YAAY,IAAI;EAC5C,IAAI,CAAC,eACH,OAAO,EAAE,QAAQ,SAAS;EAG5B,MAAM,qBAAqB,MAAMC,0CAAAA,0BAA0B,QAAQ;GACjE,QAAQ;GACR,SAAS,UAAU;GACnB,QAAQ,OAAO;GACf,aAAa,aAAa;IACxB,cAAc,aAAa,MAAM,OAAO,MAAM,WAAW;KACvD,QAAQ,SAAS,YAAY;KAC7B,QAAQ,GAAG,UAAU,SAAS,kBAAkB,GAAG,KAAK,SAAS,YAAY;IAC/E,CAAC;GACH;EACF,CAAC;EAEDC,mDAAAA,wBACE,eACA,MACA,WACA,oBACA,MACF;EAEA,IAAI,mBACF,cAAc,aAAa,MAAM,OAAO,MAAM,MAAM;EAGtD,OAAO,EAAE,QAAQ,YAAY;CAC/B;AACF"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
|
-
//#region src/core/tasks/EthereumWaitForTransactionStatusTask.d.ts
|
|
4
3
|
export declare class EthereumWaitForTransactionStatusTask extends BaseStepExecutionTask {
|
|
5
4
|
run(context: EthereumStepExecutorContext): Promise<TaskResult>;
|
|
6
|
-
}
|
|
7
|
-
//#endregion
|
|
8
|
-
//# sourceMappingURL=EthereumWaitForTransactionStatusTask.d.ts.map
|
|
5
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let _lifi_sdk = require("@lifi/sdk");
|
|
3
|
-
|
|
3
|
+
// src/core/tasks/EthereumWaitForTransactionStatusTask.ts
|
|
4
4
|
var EthereumWaitForTransactionStatusTask = class extends _lifi_sdk.BaseStepExecutionTask {
|
|
5
5
|
async run(context) {
|
|
6
6
|
const { step, checkClient, isBridgeExecution, statusManager } = context;
|
|
@@ -11,7 +11,6 @@ var EthereumWaitForTransactionStatusTask = class extends _lifi_sdk.BaseStepExecu
|
|
|
11
11
|
return await new _lifi_sdk.WaitForTransactionStatusTask(isBridgeExecution ? "RECEIVING_CHAIN" : "SWAP").run(context);
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
|
-
//#endregion
|
|
15
14
|
exports.EthereumWaitForTransactionStatusTask = EthereumWaitForTransactionStatusTask;
|
|
16
15
|
|
|
17
16
|
//# sourceMappingURL=EthereumWaitForTransactionStatusTask.js.map
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
|
-
//#region src/core/tasks/EthereumWaitForTransactionTask.d.ts
|
|
4
3
|
export declare class EthereumWaitForTransactionTask extends BaseStepExecutionTask {
|
|
5
4
|
run(context: EthereumStepExecutorContext): Promise<TaskResult>;
|
|
6
|
-
}
|
|
7
|
-
//#endregion
|
|
8
|
-
//# sourceMappingURL=EthereumWaitForTransactionTask.d.ts.map
|
|
5
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_core_tasks_helpers_getEthereumExecutionStrategy = require("./helpers/getEthereumExecutionStrategy.js");
|
|
3
2
|
const require_core_tasks_EthereumBatchedWaitForTransactionTask = require("./EthereumBatchedWaitForTransactionTask.js");
|
|
4
3
|
const require_core_tasks_EthereumRelayedWaitForTransactionTask = require("./EthereumRelayedWaitForTransactionTask.js");
|
|
5
4
|
const require_core_tasks_EthereumStandardWaitForTransactionTask = require("./EthereumStandardWaitForTransactionTask.js");
|
|
5
|
+
const require_core_tasks_helpers_getEthereumExecutionStrategy = require("./helpers/getEthereumExecutionStrategy.js");
|
|
6
6
|
let _lifi_sdk = require("@lifi/sdk");
|
|
7
|
-
|
|
7
|
+
// src/core/tasks/EthereumWaitForTransactionTask.ts
|
|
8
8
|
const TRANSACTION_METHOD_TYPES = [
|
|
9
9
|
"standard",
|
|
10
10
|
"batched",
|
|
@@ -20,7 +20,6 @@ var EthereumWaitForTransactionTask = class extends _lifi_sdk.BaseStepExecutionTa
|
|
|
20
20
|
return new require_core_tasks_EthereumStandardWaitForTransactionTask.EthereumStandardWaitForTransactionTask().run(context);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
//#endregion
|
|
24
23
|
exports.EthereumWaitForTransactionTask = EthereumWaitForTransactionTask;
|
|
25
24
|
|
|
26
25
|
//# sourceMappingURL=EthereumWaitForTransactionTask.js.map
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import { SDKClient, TransactionParameters } from "@lifi/sdk";
|
|
2
2
|
import { Client } from "viem";
|
|
3
|
-
|
|
4
|
-
export declare const estimateTransactionRequest: (client: SDKClient, viemClient: Client, transactionRequest: TransactionParameters) => Promise<TransactionParameters>;
|
|
5
|
-
//#endregion
|
|
6
|
-
//# sourceMappingURL=estimateTransactionRequest.d.ts.map
|
|
3
|
+
export declare const estimateTransactionRequest: (client: SDKClient, viemClient: Client, transactionRequest: TransactionParameters, chainId: number | undefined) => Promise<TransactionParameters>;
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_utils_getActionWithFallback = require("../../../utils/getActionWithFallback.js");
|
|
3
3
|
let viem_actions = require("viem/actions");
|
|
4
|
-
|
|
4
|
+
// src/core/tasks/helpers/estimateTransactionRequest.ts
|
|
5
5
|
const GAS_ESTIMATION_BUFFER = 300000n;
|
|
6
|
-
const estimateTransactionRequest = async (client, viemClient, transactionRequest) => {
|
|
6
|
+
const estimateTransactionRequest = async (client, viemClient, transactionRequest, chainId) => {
|
|
7
7
|
try {
|
|
8
8
|
const estimatedGas = await require_utils_getActionWithFallback.getActionWithFallback(client, viemClient, viem_actions.estimateGas, "estimateGas", {
|
|
9
9
|
account: viemClient.account,
|
|
10
10
|
to: transactionRequest.to,
|
|
11
11
|
data: transactionRequest.data,
|
|
12
12
|
value: transactionRequest.value
|
|
13
|
-
});
|
|
13
|
+
}, chainId);
|
|
14
14
|
transactionRequest.gas = (transactionRequest.gas && transactionRequest.gas > estimatedGas ? transactionRequest.gas : estimatedGas) + GAS_ESTIMATION_BUFFER;
|
|
15
15
|
} catch (_) {
|
|
16
16
|
if (transactionRequest.gas) transactionRequest.gas = transactionRequest.gas + GAS_ESTIMATION_BUFFER;
|
|
17
17
|
}
|
|
18
18
|
return transactionRequest;
|
|
19
19
|
};
|
|
20
|
-
//#endregion
|
|
21
20
|
exports.estimateTransactionRequest = estimateTransactionRequest;
|
|
22
21
|
|
|
23
22
|
//# sourceMappingURL=estimateTransactionRequest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"estimateTransactionRequest.js","names":["getActionWithFallback","estimateGas"],"sources":["../../../../../src/core/tasks/helpers/estimateTransactionRequest.ts"],"sourcesContent":["import type { SDKClient, TransactionParameters } from '@lifi/sdk'\nimport type { Address, Client, Hex } from 'viem'\nimport { estimateGas } from 'viem/actions'\nimport { getActionWithFallback } from '../../../utils/getActionWithFallback.js'\n\nconst GAS_ESTIMATION_BUFFER = 300_000n\n\nexport const estimateTransactionRequest = async (\n client: SDKClient,\n viemClient: Client,\n transactionRequest: TransactionParameters\n): Promise<TransactionParameters> => {\n try {\n // Try to re-estimate the gas due to additional Permit data\n const estimatedGas = await getActionWithFallback(\n client,\n viemClient,\n estimateGas,\n 'estimateGas',\n {\n account: viemClient.account!,\n to: transactionRequest.to as Address,\n data: transactionRequest.data as Hex,\n value: transactionRequest.value,\n }\n )\n // Use the higher of estimated vs original, then add buffer\n const baseGas =\n transactionRequest.gas && transactionRequest.gas > estimatedGas\n ? transactionRequest.gas\n : estimatedGas\n\n transactionRequest.gas = baseGas + GAS_ESTIMATION_BUFFER\n } catch (_) {\n // If estimation fails, add buffer to existing gas limit\n if (transactionRequest.gas) {\n transactionRequest.gas = transactionRequest.gas + GAS_ESTIMATION_BUFFER\n }\n }\n\n return transactionRequest\n}\n"],"mappings":";;;;AAKA,MAAM,wBAAwB;AAE9B,MAAa,6BAA6B,OACxC,QACA,YACA,
|
|
1
|
+
{"version":3,"file":"estimateTransactionRequest.js","names":["getActionWithFallback","estimateGas"],"sources":["../../../../../src/core/tasks/helpers/estimateTransactionRequest.ts"],"sourcesContent":["import type { SDKClient, TransactionParameters } from '@lifi/sdk'\nimport type { Address, Client, Hex } from 'viem'\nimport { estimateGas } from 'viem/actions'\nimport { getActionWithFallback } from '../../../utils/getActionWithFallback.js'\n\nconst GAS_ESTIMATION_BUFFER = 300_000n\n\nexport const estimateTransactionRequest = async (\n client: SDKClient,\n viemClient: Client,\n transactionRequest: TransactionParameters,\n chainId: number | undefined\n): Promise<TransactionParameters> => {\n try {\n // Try to re-estimate the gas due to additional Permit data\n const estimatedGas = await getActionWithFallback(\n client,\n viemClient,\n estimateGas,\n 'estimateGas',\n {\n account: viemClient.account!,\n to: transactionRequest.to as Address,\n data: transactionRequest.data as Hex,\n value: transactionRequest.value,\n },\n chainId\n )\n // Use the higher of estimated vs original, then add buffer\n const baseGas =\n transactionRequest.gas && transactionRequest.gas > estimatedGas\n ? transactionRequest.gas\n : estimatedGas\n\n transactionRequest.gas = baseGas + GAS_ESTIMATION_BUFFER\n } catch (_) {\n // If estimation fails, add buffer to existing gas limit\n if (transactionRequest.gas) {\n transactionRequest.gas = transactionRequest.gas + GAS_ESTIMATION_BUFFER\n }\n }\n\n return transactionRequest\n}\n"],"mappings":";;;;AAKA,MAAM,wBAAwB;AAE9B,MAAa,6BAA6B,OACxC,QACA,YACA,oBACA,YACmC;CACnC,IAAI;EAEF,MAAM,eAAe,MAAMA,oCAAAA,sBACzB,QACA,YACAC,aAAAA,aACA,eACA;GACE,SAAS,WAAW;GACpB,IAAI,mBAAmB;GACvB,MAAM,mBAAmB;GACzB,OAAO,mBAAmB;EAC5B,GACA,OACF;EAOA,mBAAmB,OAJjB,mBAAmB,OAAO,mBAAmB,MAAM,eAC/C,mBAAmB,MACnB,gBAE6B;CACrC,SAAS,GAAG;EAEV,IAAI,mBAAmB,KACrB,mBAAmB,MAAM,mBAAmB,MAAM;CAEtD;CAEA,OAAO;AACT"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../../types.js";
|
|
2
2
|
import { SignedTypedData } from "@lifi/sdk";
|
|
3
|
-
//#region src/core/tasks/helpers/findSignedNativePermit.d.ts
|
|
4
3
|
/** The signed native EIP-2612 permit this step should execute through, if any. */
|
|
5
|
-
export declare function findSignedNativePermit(context: EthereumStepExecutorContext): SignedTypedData | undefined;
|
|
6
|
-
//#endregion
|
|
7
|
-
//# sourceMappingURL=findSignedNativePermit.d.ts.map
|
|
4
|
+
export declare function findSignedNativePermit(context: EthereumStepExecutorContext): SignedTypedData | undefined;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_core_tasks_helpers_hasPermit2AllowanceInFlight = require("./hasPermit2AllowanceInFlight.js");
|
|
3
2
|
const require_utils_getDomainChainId = require("../../../utils/getDomainChainId.js");
|
|
4
3
|
const require_utils_isValidSignature = require("../../../utils/isValidSignature.js");
|
|
5
|
-
|
|
4
|
+
const require_core_tasks_helpers_hasPermit2AllowanceInFlight = require("./hasPermit2AllowanceInFlight.js");
|
|
5
|
+
// src/core/tasks/helpers/findSignedNativePermit.ts
|
|
6
6
|
/** The signed native EIP-2612 permit this step should execute through, if any. */
|
|
7
7
|
function findSignedNativePermit(context) {
|
|
8
8
|
const { fromChain, signedTypedData } = context;
|
|
9
9
|
if (require_core_tasks_helpers_hasPermit2AllowanceInFlight.isPermit2AllowanceLaneInFlight(context)) return;
|
|
10
10
|
return signedTypedData.find((typedData) => typedData.primaryType === "Permit" && require_utils_getDomainChainId.getDomainChainId(typedData.domain) === fromChain.id && require_utils_isValidSignature.isValidSignature(typedData.signature));
|
|
11
11
|
}
|
|
12
|
-
//#endregion
|
|
13
12
|
exports.findSignedNativePermit = findSignedNativePermit;
|
|
14
13
|
|
|
15
14
|
//# sourceMappingURL=findSignedNativePermit.js.map
|