@lifi/sdk-provider-ethereum 4.2.11 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +66 -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 +4 -3
- 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 +17 -0
- package/dist/cjs/core/tasks/EthereumCheckAllowanceAfterPrepareTask.js +33 -0
- package/dist/cjs/core/tasks/EthereumCheckAllowanceAfterPrepareTask.js.map +1 -0
- 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 +8 -0
- package/dist/cjs/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.js +16 -0
- package/dist/cjs/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.js.map +1 -0
- 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 +6 -7
- 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 +4 -3
- 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 +18 -0
- package/dist/esm/core/tasks/EthereumCheckAllowanceAfterPrepareTask.d.ts.map +1 -0
- package/dist/esm/core/tasks/EthereumCheckAllowanceAfterPrepareTask.js +32 -0
- package/dist/esm/core/tasks/EthereumCheckAllowanceAfterPrepareTask.js.map +1 -0
- 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 +9 -0
- package/dist/esm/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.d.ts.map +1 -0
- package/dist/esm/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.js +15 -0
- package/dist/esm/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.js.map +1 -0
- 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 +6 -7
- 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/EthereumStepExecutor.ts +2 -0
- package/src/core/tasks/EthereumBatchedSignAndExecuteTask.ts +4 -0
- package/src/core/tasks/EthereumCheckAllowanceAfterPrepareTask.ts +34 -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/hasApprovalAddressAppearedAtPrepare.ts +29 -0
- 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,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
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../../types.js";
|
|
2
|
-
//#region src/core/tasks/helpers/getApprovalAmount.d.ts
|
|
3
2
|
/** How much of the source token to approve to the step's approval address. */
|
|
4
|
-
export declare function getApprovalAmount(context: EthereumStepExecutorContext, permit2Supported: boolean): bigint;
|
|
5
|
-
//#endregion
|
|
6
|
-
//# sourceMappingURL=getApprovalAmount.d.ts.map
|
|
3
|
+
export declare function getApprovalAmount(context: EthereumStepExecutorContext, permit2Supported: boolean): bigint;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_utils_getTypedDataLane = require("../../../utils/getTypedDataLane.js");
|
|
3
2
|
const require_permits_constants = require("../../../permits/constants.js");
|
|
4
|
-
|
|
3
|
+
const require_utils_getTypedDataLane = require("../../../utils/getTypedDataLane.js");
|
|
4
|
+
// src/core/tasks/helpers/getApprovalAmount.ts
|
|
5
5
|
/** How much of the source token to approve to the step's approval address. */
|
|
6
6
|
function getApprovalAmount(context, permit2Supported) {
|
|
7
7
|
const { step, fromChain, disableMessageSigning } = context;
|
|
@@ -10,7 +10,6 @@ function getApprovalAmount(context, permit2Supported) {
|
|
|
10
10
|
const approvalAddress = step.estimate.approvalAddress?.toLowerCase();
|
|
11
11
|
return permit2Allowances.length > 0 && !!approvalAddress && permit2Allowances.every((typedData) => typedData.domain.verifyingContract?.toLowerCase() === approvalAddress) ? require_permits_constants.MaxUint256 : BigInt(step.action.fromAmount);
|
|
12
12
|
}
|
|
13
|
-
//#endregion
|
|
14
13
|
exports.getApprovalAmount = getApprovalAmount;
|
|
15
14
|
|
|
16
15
|
//# sourceMappingURL=getApprovalAmount.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../../types.js";
|
|
2
2
|
import { TransactionMethodType } from "@lifi/sdk";
|
|
3
|
-
//#region src/core/tasks/helpers/getEthereumExecutionStrategy.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Retry param set by `EthereumPrepareTransactionTask`: the strategy prepare
|
|
6
5
|
* established when the allowance work done for `batched` did not fit it. The
|
|
@@ -18,6 +17,4 @@ export declare const STRATEGY_AFTER_PREPARE = "strategyAfterPrepare";
|
|
|
18
17
|
* not-yet-known. Both effects come from that one fact, which is why they share
|
|
19
18
|
* a parameter.
|
|
20
19
|
*/
|
|
21
|
-
export declare function getEthereumExecutionStrategy(context: EthereumStepExecutorContext, afterPrepare?: boolean): Promise<TransactionMethodType>;
|
|
22
|
-
//#endregion
|
|
23
|
-
//# sourceMappingURL=getEthereumExecutionStrategy.d.ts.map
|
|
20
|
+
export declare function getEthereumExecutionStrategy(context: EthereumStepExecutorContext, afterPrepare?: boolean): Promise<TransactionMethodType>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_actions_isBatchingSupported = require("../../../actions/isBatchingSupported.js");
|
|
3
3
|
const require_utils_getTypedDataLane = require("../../../utils/getTypedDataLane.js");
|
|
4
|
-
|
|
4
|
+
let _lifi_sdk = require("@lifi/sdk");
|
|
5
|
+
// src/core/tasks/helpers/getEthereumExecutionStrategy.ts
|
|
5
6
|
/**
|
|
6
7
|
* Retry param set by `EthereumPrepareTransactionTask`: the strategy prepare
|
|
7
8
|
* established when the allowance work done for `batched` did not fit it. The
|
|
@@ -30,18 +31,19 @@ async function getEthereumExecutionStrategy(context, afterPrepare = false) {
|
|
|
30
31
|
if (!afterPrepare && executionStrategyContext) return executionStrategyContext;
|
|
31
32
|
const strategyAfterPrepare = retryParams?.[STRATEGY_AFTER_PREPARE];
|
|
32
33
|
if (!afterPrepare && isTransactionMethodType(strategyAfterPrepare)) return strategyAfterPrepare;
|
|
34
|
+
if ((0, _lifi_sdk.isGaslessStep)(step)) return "relayed";
|
|
33
35
|
const atomicityNotReady = !!retryParams?.atomicityNotReady;
|
|
34
36
|
if (step.executionType === "message") return "relayed";
|
|
35
37
|
if (step.typedData?.length && !require_utils_getTypedDataLane.isPermit2AllowanceLane(step, fromChain)) return "relayed";
|
|
36
38
|
if (afterPrepare && step.typedData?.length && !step.transactionRequest) return "relayed";
|
|
37
39
|
if (atomicityNotReady || step.tool === "thorswap") return "standard";
|
|
38
40
|
const updatedClient = await checkClient(step) ?? ethereumClient;
|
|
39
|
-
|
|
41
|
+
context.batchingSupported ??= require_actions_isBatchingSupported.isBatchingSupported(client, {
|
|
40
42
|
client: updatedClient,
|
|
41
43
|
chainId: fromChain.id
|
|
42
|
-
})
|
|
44
|
+
});
|
|
45
|
+
return await context.batchingSupported ? "batched" : "standard";
|
|
43
46
|
}
|
|
44
|
-
//#endregion
|
|
45
47
|
exports.STRATEGY_AFTER_PREPARE = STRATEGY_AFTER_PREPARE;
|
|
46
48
|
exports.getEthereumExecutionStrategy = getEthereumExecutionStrategy;
|
|
47
49
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEthereumExecutionStrategy.js","names":["isPermit2AllowanceLane","isBatchingSupported"],"sources":["../../../../../src/core/tasks/helpers/getEthereumExecutionStrategy.ts"],"sourcesContent":["import type
|
|
1
|
+
{"version":3,"file":"getEthereumExecutionStrategy.js","names":["isGaslessStep","isPermit2AllowanceLane","isBatchingSupported"],"sources":["../../../../../src/core/tasks/helpers/getEthereumExecutionStrategy.ts"],"sourcesContent":["import { isGaslessStep, type TransactionMethodType } from '@lifi/sdk'\nimport { isBatchingSupported } from '../../../actions/isBatchingSupported.js'\nimport type { EthereumStepExecutorContext } from '../../../types.js'\nimport { isPermit2AllowanceLane } from '../../../utils/getTypedDataLane.js'\n\n/**\n * Retry param set by `EthereumPrepareTransactionTask`: the strategy prepare\n * established when the allowance work done for `batched` did not fit it. The\n * replay starts in this strategy.\n */\nexport const STRATEGY_AFTER_PREPARE = 'strategyAfterPrepare'\n\n// A `Record` over the union, so a new strategy fails to compile here instead of\n// being ignored by the replay.\nconst TRANSACTION_METHOD_TYPES: Record<TransactionMethodType, true> = {\n standard: true,\n relayed: true,\n batched: true,\n}\n\nconst isTransactionMethodType = (\n value: unknown\n): value is TransactionMethodType =>\n typeof value === 'string' && Object.hasOwn(TRANSACTION_METHOD_TYPES, value)\n\n/**\n * Determines the execution strategy: 'relayed', 'batched', or 'standard'.\n * Falls back to 'standard' when EIP-5792 batching is unavailable,\n * the wallet rejected the 7702 upgrade, or the tool doesn't support it.\n *\n * `afterPrepare` marks the single call from `EthereumPrepareTransactionTask`.\n * The step has just been re-quoted, so the cached verdict is stale and, for the\n * first time, the absence of a `transactionRequest` is final rather than merely\n * not-yet-known. Both effects come from that one fact, which is why they share\n * a parameter.\n */\nexport async function getEthereumExecutionStrategy(\n context: EthereumStepExecutorContext,\n afterPrepare: boolean = false\n): Promise<TransactionMethodType> {\n const {\n step,\n checkClient,\n retryParams,\n client,\n fromChain,\n ethereumClient,\n executionStrategy: executionStrategyContext,\n } = context\n\n if (!afterPrepare && executionStrategyContext) {\n return executionStrategyContext\n }\n\n // A replay starts in the strategy its first prepare established. Prepare\n // restored the step's typed data before the replay, so nothing on the step\n // shows that strategy yet.\n const strategyAfterPrepare = retryParams?.[STRATEGY_AFTER_PREPARE]\n if (!afterPrepare && isTransactionMethodType(strategyAfterPrepare)) {\n return strategyAfterPrepare\n }\n\n // A gasless step only executes through the relay. Before prepare it has no\n // typed data yet, so the relay fee is the only signal.\n if (isGaslessStep(step)) {\n return 'relayed'\n }\n\n const atomicityNotReady = !!retryParams?.atomicityNotReady\n\n // Declared by the backend. It is the only signal that reaches the allowance\n // tasks, which run before a `transactionRequest` can exist.\n if (step.executionType === 'message') {\n return 'relayed'\n }\n\n // Typed data the user does not sign for its own send: gasless, `Order`,\n // Hyperliquid. A Permit2 allowance is the one shape excluded, because its signer\n // and its sender are the same person.\n if (step.typedData?.length && !isPermit2AllowanceLane(step, fromChain)) {\n return 'relayed'\n }\n\n // After prepare, missing means never: the step carries typed data and the user\n // has nothing to send, so the relayer is the only lane that can execute it.\n // This is a derivation, not a guess — no other strategy can run such a step.\n //\n // Before prepare the same expression is unsound. A Permit2 allowance that will\n // receive its transaction from `/stepTransaction` is indistinguishable from\n // one that never will, and calling it relayed there costs the step its\n // EIP-5792 batching.\n if (afterPrepare && step.typedData?.length && !step.transactionRequest) {\n return 'relayed'\n }\n\n if (atomicityNotReady || step.tool === 'thorswap') {\n return 'standard'\n }\n\n const updatedClient = (await checkClient(step)) ?? ethereumClient\n // A re-quote changes the step, not the wallet: prepare reuses the answer the\n // allowance tasks acted on, so a late read cannot flip the strategy.\n context.batchingSupported ??= isBatchingSupported(client, {\n client: updatedClient,\n chainId: fromChain.id,\n })\n return (await context.batchingSupported) ? 'batched' : 'standard'\n}\n"],"mappings":";;;;;;;;;;AAUA,MAAa,yBAAyB;AAItC,MAAM,2BAAgE;CACpE,UAAU;CACV,SAAS;CACT,SAAS;AACX;AAEA,MAAM,2BACJ,UAEA,OAAO,UAAU,YAAY,OAAO,OAAO,0BAA0B,KAAK;;;;;;;;;;;;AAa5E,eAAsB,6BACpB,SACA,eAAwB,OACQ;CAChC,MAAM,EACJ,MACA,aACA,aACA,QACA,WACA,gBACA,mBAAmB,6BACjB;CAEJ,IAAI,CAAC,gBAAgB,0BACnB,OAAO;CAMT,MAAM,uBAAuB,cAAc;CAC3C,IAAI,CAAC,gBAAgB,wBAAwB,oBAAoB,GAC/D,OAAO;CAKT,KAAA,GAAIA,UAAAA,cAAAA,CAAc,IAAI,GACpB,OAAO;CAGT,MAAM,oBAAoB,CAAC,CAAC,aAAa;CAIzC,IAAI,KAAK,kBAAkB,WACzB,OAAO;CAMT,IAAI,KAAK,WAAW,UAAU,CAACC,+BAAAA,uBAAuB,MAAM,SAAS,GACnE,OAAO;CAWT,IAAI,gBAAgB,KAAK,WAAW,UAAU,CAAC,KAAK,oBAClD,OAAO;CAGT,IAAI,qBAAqB,KAAK,SAAS,YACrC,OAAO;CAGT,MAAM,gBAAiB,MAAM,YAAY,IAAI,KAAM;CAGnD,QAAQ,sBAAsBC,oCAAAA,oBAAoB,QAAQ;EACxD,QAAQ;EACR,SAAS,UAAU;CACrB,CAAC;CACD,OAAQ,MAAM,QAAQ,oBAAqB,YAAY;AACzD"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import { ExtendedChain } from "@lifi/sdk";
|
|
2
2
|
import { Hash } from "viem";
|
|
3
|
-
|
|
4
|
-
export declare const getTxLink: (chain: ExtendedChain, txHash: Hash) => string;
|
|
5
|
-
//#endregion
|
|
6
|
-
//# sourceMappingURL=getTxLink.d.ts.map
|
|
3
|
+
export declare const getTxLink: (chain: ExtendedChain, txHash: Hash) => string;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/core/tasks/helpers/getTxLink.ts
|
|
3
3
|
const getTxLink = (chain, txHash) => {
|
|
4
4
|
return `${chain.metamask.blockExplorerUrls[0]}tx/${txHash}`;
|
|
5
5
|
};
|
|
6
|
-
//#endregion
|
|
7
6
|
exports.getTxLink = getTxLink;
|
|
8
7
|
|
|
9
8
|
//# sourceMappingURL=getTxLink.js.map
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { ExecutionOptions,
|
|
2
|
-
//#region src/core/tasks/helpers/getUpdatedStep.d.ts
|
|
1
|
+
import { ExecutionOptions, LiFiStepExtended, SDKClient, SignedTypedData } from "@lifi/sdk";
|
|
3
2
|
/** Re-quotes the step through the endpoint that matches how it will execute. */
|
|
4
|
-
export declare const getUpdatedStep: (client: SDKClient, step: LiFiStepExtended,
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
export declare const getUpdatedStep: (client: SDKClient, step: LiFiStepExtended, executionOptions?: ExecutionOptions, signedTypedData?: SignedTypedData[]) => Promise<LiFiStepExtended>;
|
|
4
|
+
/**
|
|
5
|
+
* Fields `/advanced/stepTransaction` adds to a gasless step. They are not in
|
|
6
|
+
* `@lifi/types` yet.
|
|
7
|
+
*/
|
|
8
|
+
export type GaslessStepFields = {
|
|
9
|
+
expiresAt?: number;
|
|
10
|
+
authorization?: unknown;
|
|
11
|
+
};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_utils_isGaslessStep = require("../../../utils/isGaslessStep.js");
|
|
3
2
|
const require_permits_constants = require("../../../permits/constants.js");
|
|
4
3
|
const require_utils_isContractCallStep = require("../../../utils/isContractCallStep.js");
|
|
5
4
|
let _lifi_sdk = require("@lifi/sdk");
|
|
6
|
-
|
|
5
|
+
// src/core/tasks/helpers/getUpdatedStep.ts
|
|
7
6
|
/** Re-quotes the step through the endpoint that matches how it will execute. */
|
|
8
|
-
const getUpdatedStep = async (client, step,
|
|
7
|
+
const getUpdatedStep = async (client, step, executionOptions, signedTypedData) => {
|
|
9
8
|
if (require_utils_isContractCallStep.isContractCallStep(step)) return getContractCallUpdatedStep(client, step, executionOptions);
|
|
10
|
-
if (
|
|
9
|
+
if ((0, _lifi_sdk.isGaslessStep)(step)) return getGaslessUpdatedStep(client, step);
|
|
11
10
|
return getStandardUpdatedStep(client, step, signedTypedData);
|
|
12
11
|
};
|
|
13
12
|
const getContractCallUpdatedStep = async (client, step, executionOptions) => {
|
|
@@ -71,21 +70,14 @@ const getContractCallUpdatedStep = async (client, step, executionOptions) => {
|
|
|
71
70
|
id: step.id
|
|
72
71
|
};
|
|
73
72
|
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
toToken: step.action.toToken.address,
|
|
83
|
-
slippage: step.action.slippage,
|
|
84
|
-
toAddress: step.action.toAddress,
|
|
85
|
-
allowBridges: [step.tool]
|
|
86
|
-
}),
|
|
87
|
-
id: step.id
|
|
88
|
-
};
|
|
73
|
+
/**
|
|
74
|
+
* A gasless step is re-quoted as the routes response gave it: the backend
|
|
75
|
+
* rejects typed data without signatures, and it builds new typed data, a new
|
|
76
|
+
* deadline and new nonces for every quote anyway.
|
|
77
|
+
*/
|
|
78
|
+
const getGaslessUpdatedStep = async (client, step) => {
|
|
79
|
+
const { typedData: _typedData, expiresAt: _expiresAt, authorization: _authorization, execution: _execution, ...restStep } = step;
|
|
80
|
+
return (0, _lifi_sdk.getStepTransaction)(client, restStep);
|
|
89
81
|
};
|
|
90
82
|
const getStandardUpdatedStep = async (client, step, signedTypedData) => {
|
|
91
83
|
const filteredSignedTypedData = signedTypedData?.filter((item) => item.signature);
|
|
@@ -96,7 +88,6 @@ const getStandardUpdatedStep = async (client, step, signedTypedData) => {
|
|
|
96
88
|
} : restStep;
|
|
97
89
|
return (0, _lifi_sdk.getStepTransaction)(client, params);
|
|
98
90
|
};
|
|
99
|
-
//#endregion
|
|
100
91
|
exports.getUpdatedStep = getUpdatedStep;
|
|
101
92
|
|
|
102
93
|
//# sourceMappingURL=getUpdatedStep.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUpdatedStep.js","names":["isContractCallStep","isGaslessStep","TransactionError","LiFiErrorCode","patchContractCalls","PatcherMagicNumber","getContractCallsQuote","convertQuoteToRoute","
|
|
1
|
+
{"version":3,"file":"getUpdatedStep.js","names":["isContractCallStep","isGaslessStep","TransactionError","LiFiErrorCode","patchContractCalls","PatcherMagicNumber","getContractCallsQuote","convertQuoteToRoute","getStepTransaction"],"sources":["../../../../../src/core/tasks/helpers/getUpdatedStep.ts"],"sourcesContent":["import {\n convertQuoteToRoute,\n type ExecutionOptions,\n getContractCallsQuote,\n getStepTransaction,\n isGaslessStep,\n LiFiErrorCode,\n type LiFiStepExtended,\n patchContractCalls,\n type SDKClient,\n type SignedTypedData,\n TransactionError,\n} from '@lifi/sdk'\nimport { PatcherMagicNumber } from '../../../permits/constants.js'\nimport { isContractCallStep } from '../../../utils/isContractCallStep.js'\n\n/** Re-quotes the step through the endpoint that matches how it will execute. */\nexport const getUpdatedStep = async (\n client: SDKClient,\n step: LiFiStepExtended,\n executionOptions?: ExecutionOptions,\n signedTypedData?: SignedTypedData[]\n): Promise<LiFiStepExtended> => {\n if (isContractCallStep(step)) {\n return getContractCallUpdatedStep(client, step, executionOptions)\n }\n if (isGaslessStep(step)) {\n return getGaslessUpdatedStep(client, step)\n }\n return getStandardUpdatedStep(client, step, signedTypedData)\n}\n\nconst getContractCallUpdatedStep = async (\n client: SDKClient,\n step: LiFiStepExtended,\n executionOptions?: ExecutionOptions\n): Promise<LiFiStepExtended> => {\n const contractCallsResult = await executionOptions?.getContractCalls?.({\n fromAddress: step.action.fromAddress!,\n fromAmount: BigInt(step.action.fromAmount),\n fromChainId: step.action.fromChainId,\n fromTokenAddress: step.action.fromToken.address,\n slippage: step.action.slippage,\n toAddress: step.action.toAddress,\n toAmount: BigInt(step.estimate.toAmount),\n toChainId: step.action.toChainId,\n toTokenAddress: step.action.toToken.address,\n })\n\n if (!contractCallsResult?.contractCalls?.length) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Contract calls are not found.'\n )\n }\n\n if (contractCallsResult.patcher) {\n const patchedContractCalls = await patchContractCalls(\n client,\n contractCallsResult.contractCalls.map((call) => ({\n chainId: step.action.toChainId,\n fromTokenAddress: call.fromTokenAddress,\n targetContractAddress: call.toContractAddress,\n callDataToPatch: call.toContractCallData,\n delegateCall: false,\n patches: [\n {\n amountToReplace: PatcherMagicNumber.toString(),\n },\n ],\n }))\n )\n\n contractCallsResult.contractCalls.forEach((call, index) => {\n call.toContractAddress = patchedContractCalls[index].target\n call.toContractCallData = patchedContractCalls[index].callData\n })\n }\n\n /**\n * Limitations of the retry logic for contract calls:\n * - denyBridges and denyExchanges are not supported\n * - allowBridges and allowExchanges are not supported\n * - fee is not supported\n * - toAmount is not supported\n */\n const contractCallQuote = await getContractCallsQuote(client, {\n fromAddress: step.action.fromAddress!,\n fromChain: step.action.fromChainId,\n fromToken: step.action.fromToken.address,\n fromAmount: step.action.fromAmount,\n toChain: step.action.toChainId,\n toToken: step.action.toToken.address,\n contractCalls: contractCallsResult.contractCalls,\n toFallbackAddress: step.action.toAddress,\n slippage: step.action.slippage,\n })\n\n contractCallQuote.action.toToken = step.action.toToken\n\n const customStep = contractCallQuote.includedSteps?.find(\n (s) => s.type === 'custom'\n )\n if (customStep && contractCallsResult?.contractTool) {\n const toolDetails = {\n key: contractCallsResult.contractTool.name,\n name: contractCallsResult.contractTool.name,\n logoURI: contractCallsResult.contractTool.logoURI,\n }\n customStep.toolDetails = toolDetails\n contractCallQuote.toolDetails = toolDetails\n }\n\n const route = convertQuoteToRoute(contractCallQuote, {\n adjustZeroOutputFromPreviousStep:\n executionOptions?.adjustZeroOutputFromPreviousStep,\n })\n\n return {\n ...route.steps[0],\n id: step.id,\n }\n}\n\n/**\n * Fields `/advanced/stepTransaction` adds to a gasless step. They are not in\n * `@lifi/types` yet.\n */\nexport type GaslessStepFields = {\n expiresAt?: number\n authorization?: unknown\n}\n\n/**\n * A gasless step is re-quoted as the routes response gave it: the backend\n * rejects typed data without signatures, and it builds new typed data, a new\n * deadline and new nonces for every quote anyway.\n */\nconst getGaslessUpdatedStep = async (\n client: SDKClient,\n step: LiFiStepExtended\n): Promise<LiFiStepExtended> => {\n const {\n typedData: _typedData,\n expiresAt: _expiresAt,\n authorization: _authorization,\n execution: _execution,\n ...restStep\n } = step as LiFiStepExtended & GaslessStepFields\n return getStepTransaction(client, restStep)\n}\n\nconst getStandardUpdatedStep = async (\n client: SDKClient,\n step: LiFiStepExtended,\n signedTypedData?: SignedTypedData[]\n): Promise<LiFiStepExtended> => {\n const filteredSignedTypedData = signedTypedData?.filter(\n (item) => item.signature\n )\n const { typedData: _, ...restStep } = step\n const params = filteredSignedTypedData?.length\n ? { ...restStep, typedData: filteredSignedTypedData }\n : restStep\n return getStepTransaction(client, params)\n}\n"],"mappings":";;;;;;AAiBA,MAAa,iBAAiB,OAC5B,QACA,MACA,kBACA,oBAC8B;CAC9B,IAAIA,iCAAAA,mBAAmB,IAAI,GACzB,OAAO,2BAA2B,QAAQ,MAAM,gBAAgB;CAElE,KAAA,GAAIC,UAAAA,cAAAA,CAAc,IAAI,GACpB,OAAO,sBAAsB,QAAQ,IAAI;CAE3C,OAAO,uBAAuB,QAAQ,MAAM,eAAe;AAC7D;AAEA,MAAM,6BAA6B,OACjC,QACA,MACA,qBAC8B;CAC9B,MAAM,sBAAsB,MAAM,kBAAkB,mBAAmB;EACrE,aAAa,KAAK,OAAO;EACzB,YAAY,OAAO,KAAK,OAAO,UAAU;EACzC,aAAa,KAAK,OAAO;EACzB,kBAAkB,KAAK,OAAO,UAAU;EACxC,UAAU,KAAK,OAAO;EACtB,WAAW,KAAK,OAAO;EACvB,UAAU,OAAO,KAAK,SAAS,QAAQ;EACvC,WAAW,KAAK,OAAO;EACvB,gBAAgB,KAAK,OAAO,QAAQ;CACtC,CAAC;CAED,IAAI,CAAC,qBAAqB,eAAe,QACvC,MAAM,IAAIC,UAAAA,iBACRC,UAAAA,cAAc,uBACd,8DACF;CAGF,IAAI,oBAAoB,SAAS;EAC/B,MAAM,uBAAuB,OAAA,GAAMC,UAAAA,mBAAAA,CACjC,QACA,oBAAoB,cAAc,KAAK,UAAU;GAC/C,SAAS,KAAK,OAAO;GACrB,kBAAkB,KAAK;GACvB,uBAAuB,KAAK;GAC5B,iBAAiB,KAAK;GACtB,cAAc;GACd,SAAS,CACP,EACE,iBAAiBC,0BAAAA,mBAAmB,SAAS,EAC/C,CACF;EACF,EAAE,CACJ;EAEA,oBAAoB,cAAc,SAAS,MAAM,UAAU;GACzD,KAAK,oBAAoB,qBAAqB,MAAM,CAAC;GACrD,KAAK,qBAAqB,qBAAqB,MAAM,CAAC;EACxD,CAAC;CACH;;;;;;;;CASA,MAAM,oBAAoB,OAAA,GAAMC,UAAAA,sBAAAA,CAAsB,QAAQ;EAC5D,aAAa,KAAK,OAAO;EACzB,WAAW,KAAK,OAAO;EACvB,WAAW,KAAK,OAAO,UAAU;EACjC,YAAY,KAAK,OAAO;EACxB,SAAS,KAAK,OAAO;EACrB,SAAS,KAAK,OAAO,QAAQ;EAC7B,eAAe,oBAAoB;EACnC,mBAAmB,KAAK,OAAO;EAC/B,UAAU,KAAK,OAAO;CACxB,CAAC;CAED,kBAAkB,OAAO,UAAU,KAAK,OAAO;CAE/C,MAAM,aAAa,kBAAkB,eAAe,MACjD,MAAM,EAAE,SAAS,QACpB;CACA,IAAI,cAAc,qBAAqB,cAAc;EACnD,MAAM,cAAc;GAClB,KAAK,oBAAoB,aAAa;GACtC,MAAM,oBAAoB,aAAa;GACvC,SAAS,oBAAoB,aAAa;EAC5C;EACA,WAAW,cAAc;EACzB,kBAAkB,cAAc;CAClC;CAOA,OAAO;EACL,IAAA,GANYC,UAAAA,oBAAAA,CAAoB,mBAAmB,EACnD,kCACE,kBAAkB,iCACtB,CAGS,CAAC,CAAC,MAAM;EACf,IAAI,KAAK;CACX;AACF;;;;;;AAgBA,MAAM,wBAAwB,OAC5B,QACA,SAC8B;CAC9B,MAAM,EACJ,WAAW,YACX,WAAW,YACX,eAAe,gBACf,WAAW,YACX,GAAG,aACD;CACJ,QAAA,GAAOC,UAAAA,mBAAAA,CAAmB,QAAQ,QAAQ;AAC5C;AAEA,MAAM,yBAAyB,OAC7B,QACA,MACA,oBAC8B;CAC9B,MAAM,0BAA0B,iBAAiB,QAC9C,SAAS,KAAK,SACjB;CACA,MAAM,EAAE,WAAW,GAAG,GAAG,aAAa;CACtC,MAAM,SAAS,yBAAyB,SACpC;EAAE,GAAG;EAAU,WAAW;CAAwB,IAClD;CACJ,QAAA,GAAOA,UAAAA,mBAAAA,CAAmB,QAAQ,MAAM;AAC1C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EthereumStepExecutorContext } from "../../../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Whether the step had no `estimate.approvalAddress` before prepare and the
|
|
4
|
+
* re-quote brought one. No allowance was checked then (`allowanceSpender` is
|
|
5
|
+
* unset), and the step now needs it checked. The allowance tasks resolve the
|
|
6
|
+
* spender themselves, so on a Permit2 chain they approve `fromChain.permit2`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const hasApprovalAddressAppearedAtPrepare: (context: EthereumStepExecutorContext) => boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_core_tasks_helpers_shouldCheckForAllowance = require("./shouldCheckForAllowance.js");
|
|
3
|
+
// src/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.ts
|
|
4
|
+
/**
|
|
5
|
+
* Whether the step had no `estimate.approvalAddress` before prepare and the
|
|
6
|
+
* re-quote brought one. No allowance was checked then (`allowanceSpender` is
|
|
7
|
+
* unset), and the step now needs it checked. The allowance tasks resolve the
|
|
8
|
+
* spender themselves, so on a Permit2 chain they approve `fromChain.permit2`.
|
|
9
|
+
*/
|
|
10
|
+
const hasApprovalAddressAppearedAtPrepare = (context) => {
|
|
11
|
+
const { step, allowanceSpender, isBridgeExecution, isFromNativeToken, statusManager } = context;
|
|
12
|
+
return !allowanceSpender && require_core_tasks_helpers_shouldCheckForAllowance.shouldCheckForAllowance(step, isBridgeExecution, isFromNativeToken, statusManager);
|
|
13
|
+
};
|
|
14
|
+
exports.hasApprovalAddressAppearedAtPrepare = hasApprovalAddressAppearedAtPrepare;
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=hasApprovalAddressAppearedAtPrepare.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hasApprovalAddressAppearedAtPrepare.js","names":["shouldCheckForAllowance"],"sources":["../../../../../src/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.ts"],"sourcesContent":["import type { EthereumStepExecutorContext } from '../../../types.js'\nimport { shouldCheckForAllowance } from './shouldCheckForAllowance.js'\n\n/**\n * Whether the step had no `estimate.approvalAddress` before prepare and the\n * re-quote brought one. No allowance was checked then (`allowanceSpender` is\n * unset), and the step now needs it checked. The allowance tasks resolve the\n * spender themselves, so on a Permit2 chain they approve `fromChain.permit2`.\n */\nexport const hasApprovalAddressAppearedAtPrepare = (\n context: EthereumStepExecutorContext\n): boolean => {\n const {\n step,\n allowanceSpender,\n isBridgeExecution,\n isFromNativeToken,\n statusManager,\n } = context\n return (\n !allowanceSpender &&\n shouldCheckForAllowance(\n step,\n isBridgeExecution,\n isFromNativeToken,\n statusManager\n )\n )\n}\n"],"mappings":";;;;;;;;;AASA,MAAa,uCACX,YACY;CACZ,MAAM,EACJ,MACA,kBACA,mBACA,mBACA,kBACE;CACJ,OACE,CAAC,oBACDA,mDAAAA,wBACE,MACA,mBACA,mBACA,aACF;AAEJ"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../../types.js";
|
|
2
|
-
//#region src/core/tasks/helpers/hasPermit2AllowanceInFlight.d.ts
|
|
3
2
|
/** Whether this execution carries a caller-supplied Permit2 allowance, declared or signed. */
|
|
4
3
|
export declare function hasPermit2AllowanceInFlight(context: EthereumStepExecutorContext): boolean;
|
|
5
4
|
/** `isPermit2AllowanceLane`, for gates that run after prepare may have replaced `step.typedData`. */
|
|
6
|
-
export declare function isPermit2AllowanceLaneInFlight(context: EthereumStepExecutorContext): boolean;
|
|
7
|
-
//#endregion
|
|
8
|
-
//# sourceMappingURL=hasPermit2AllowanceInFlight.d.ts.map
|
|
5
|
+
export declare function isPermit2AllowanceLaneInFlight(context: EthereumStepExecutorContext): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_utils_getTypedDataLane = require("../../../utils/getTypedDataLane.js");
|
|
3
|
-
|
|
3
|
+
// src/core/tasks/helpers/hasPermit2AllowanceInFlight.ts
|
|
4
4
|
/** Whether this execution carries a caller-supplied Permit2 allowance, declared or signed. */
|
|
5
5
|
function hasPermit2AllowanceInFlight(context) {
|
|
6
6
|
const { step, fromChain, signedTypedData } = context;
|
|
@@ -10,7 +10,6 @@ function hasPermit2AllowanceInFlight(context) {
|
|
|
10
10
|
function isPermit2AllowanceLaneInFlight(context) {
|
|
11
11
|
return hasPermit2AllowanceInFlight(context) && !require_utils_getTypedDataLane.hasRelayerMessage(context.step, context.fromChain);
|
|
12
12
|
}
|
|
13
|
-
//#endregion
|
|
14
13
|
exports.hasPermit2AllowanceInFlight = hasPermit2AllowanceInFlight;
|
|
15
14
|
exports.isPermit2AllowanceLaneInFlight = isPermit2AllowanceLaneInFlight;
|
|
16
15
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../../types.js";
|
|
2
2
|
import { TransactionMethodType } from "@lifi/sdk";
|
|
3
|
-
//#region src/core/tasks/helpers/isAllowancePreparedForAnotherStrategy.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Whether the allowance work done in `preparedFor` does not fit `needed`, the
|
|
6
5
|
* strategy prepare established. Two things can break:
|
|
@@ -12,6 +11,4 @@ import { TransactionMethodType } from "@lifi/sdk";
|
|
|
12
11
|
* The spender recorded by `EthereumCheckAllowanceTask` is compared, because
|
|
13
12
|
* prepare has already replaced the step with the re-quote.
|
|
14
13
|
*/
|
|
15
|
-
export declare const isAllowancePreparedForAnotherStrategy: (context: EthereumStepExecutorContext, preparedFor: TransactionMethodType, needed: TransactionMethodType) => Promise<boolean>;
|
|
16
|
-
//#endregion
|
|
17
|
-
//# sourceMappingURL=isAllowancePreparedForAnotherStrategy.d.ts.map
|
|
14
|
+
export declare const isAllowancePreparedForAnotherStrategy: (context: EthereumStepExecutorContext, preparedFor: TransactionMethodType, needed: TransactionMethodType) => Promise<boolean>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_core_tasks_helpers_resolveAllowanceSpender = require("./resolveAllowanceSpender.js");
|
|
3
|
-
|
|
3
|
+
// src/core/tasks/helpers/isAllowancePreparedForAnotherStrategy.ts
|
|
4
4
|
/**
|
|
5
5
|
* Whether the allowance work done in `preparedFor` does not fit `needed`, the
|
|
6
6
|
* strategy prepare established. Two things can break:
|
|
@@ -21,7 +21,6 @@ const isAllowancePreparedForAnotherStrategy = async (context, preparedFor, neede
|
|
|
21
21
|
const { spenderAddress } = await require_core_tasks_helpers_resolveAllowanceSpender.resolveAllowanceSpender(context, needed);
|
|
22
22
|
return allowanceSpender.toLowerCase() !== spenderAddress?.toLowerCase();
|
|
23
23
|
};
|
|
24
|
-
//#endregion
|
|
25
24
|
exports.isAllowancePreparedForAnotherStrategy = isAllowancePreparedForAnotherStrategy;
|
|
26
25
|
|
|
27
26
|
//# sourceMappingURL=isAllowancePreparedForAnotherStrategy.js.map
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import { SignedTypedData, TypedData } from "@lifi/sdk";
|
|
2
|
-
//#region src/core/tasks/helpers/isTypedDataAlreadySigned.d.ts
|
|
3
2
|
/** Whether `signedTypedData` already holds a signature for this exact entry. */
|
|
4
|
-
export declare function isTypedDataAlreadySigned(signedTypedData: SignedTypedData[], typedData: TypedData): boolean;
|
|
5
|
-
//#endregion
|
|
6
|
-
//# sourceMappingURL=isTypedDataAlreadySigned.d.ts.map
|
|
3
|
+
export declare function isTypedDataAlreadySigned(signedTypedData: SignedTypedData[], typedData: TypedData): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_utils_isValidSignature = require("../../../utils/isValidSignature.js");
|
|
3
|
-
|
|
3
|
+
// src/core/tasks/helpers/isTypedDataAlreadySigned.ts
|
|
4
4
|
/** Whether `signedTypedData` already holds a signature for this exact entry. */
|
|
5
5
|
function isTypedDataAlreadySigned(signedTypedData, typedData) {
|
|
6
6
|
if (typedData.primaryType === "Permit") return false;
|
|
@@ -23,7 +23,6 @@ function isSameValue(a, b) {
|
|
|
23
23
|
return String(a) === String(b);
|
|
24
24
|
}
|
|
25
25
|
const isRecord = (value) => typeof value === "object" && value !== null;
|
|
26
|
-
//#endregion
|
|
27
26
|
exports.isTypedDataAlreadySigned = isTypedDataAlreadySigned;
|
|
28
27
|
|
|
29
28
|
//# sourceMappingURL=isTypedDataAlreadySigned.js.map
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { ExtendedChain, LiFiStep, LiFiStepExtended, TypedData } from "@lifi/sdk";
|
|
2
|
-
//#region src/core/tasks/helpers/preservePermit2Allowances.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* `??` keeps the Permit2 allowance only when the answer omits `typedData`. An
|
|
5
4
|
* answer that carries entries of its own — native permits, or `[]` from a
|
|
6
5
|
* third-party backend — would drop it, and `signedTypedData` resets per
|
|
7
6
|
* `executeStep`, so a retry would let the Permit2 proxy hijack the calldata.
|
|
8
7
|
*/
|
|
9
|
-
export declare function preservePermit2Allowances(step: LiFiStepExtended | LiFiStep, updatedTypedData: TypedData[] | undefined, chain: ExtendedChain): TypedData[] | undefined;
|
|
10
|
-
//#endregion
|
|
11
|
-
//# sourceMappingURL=preservePermit2Allowances.d.ts.map
|
|
8
|
+
export declare function preservePermit2Allowances(step: LiFiStepExtended | LiFiStep, updatedTypedData: TypedData[] | undefined, chain: ExtendedChain): TypedData[] | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_utils_getTypedDataLane = require("../../../utils/getTypedDataLane.js");
|
|
3
|
-
|
|
3
|
+
// src/core/tasks/helpers/preservePermit2Allowances.ts
|
|
4
4
|
/**
|
|
5
5
|
* `??` keeps the Permit2 allowance only when the answer omits `typedData`. An
|
|
6
6
|
* answer that carries entries of its own — native permits, or `[]` from a
|
|
@@ -16,7 +16,6 @@ function preservePermit2Allowances(step, updatedTypedData, chain) {
|
|
|
16
16
|
})) return updatedTypedData;
|
|
17
17
|
return [...updatedTypedData, ...require_utils_getTypedDataLane.getTypedDataInLane(step, "permit2-allowance", chain)];
|
|
18
18
|
}
|
|
19
|
-
//#endregion
|
|
20
19
|
exports.preservePermit2Allowances = preservePermit2Allowances;
|
|
21
20
|
|
|
22
21
|
//# sourceMappingURL=preservePermit2Allowances.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../../types.js";
|
|
2
2
|
import { TransactionMethodType } from "@lifi/sdk";
|
|
3
3
|
import { Address } from "viem";
|
|
4
|
-
//#region src/core/tasks/helpers/resolveAllowanceSpender.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* The spender the allowance tasks check and approve in `strategy`: canonical
|
|
7
6
|
* Permit2 when the step takes the Permit2 flow there, `approvalAddress`
|
|
@@ -11,6 +10,4 @@ import { Address } from "viem";
|
|
|
11
10
|
export declare const resolveAllowanceSpender: (context: EthereumStepExecutorContext, strategy: TransactionMethodType) => Promise<{
|
|
12
11
|
permit2Supported: boolean;
|
|
13
12
|
spenderAddress: Address;
|
|
14
|
-
}>;
|
|
15
|
-
//#endregion
|
|
16
|
-
//# sourceMappingURL=resolveAllowanceSpender.d.ts.map
|
|
13
|
+
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_core_tasks_helpers_resolvePermit2Support = require("./resolvePermit2Support.js");
|
|
3
|
-
|
|
3
|
+
// src/core/tasks/helpers/resolveAllowanceSpender.ts
|
|
4
4
|
/**
|
|
5
5
|
* The spender the allowance tasks check and approve in `strategy`: canonical
|
|
6
6
|
* Permit2 when the step takes the Permit2 flow there, `approvalAddress`
|
|
@@ -15,7 +15,6 @@ const resolveAllowanceSpender = async (context, strategy) => {
|
|
|
15
15
|
spenderAddress: permit2Supported ? fromChain.permit2 : step.estimate.approvalAddress
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
|
-
//#endregion
|
|
19
18
|
exports.resolveAllowanceSpender = resolveAllowanceSpender;
|
|
20
19
|
|
|
21
20
|
//# sourceMappingURL=resolveAllowanceSpender.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../../types.js";
|
|
2
2
|
import { TransactionMethodType } from "@lifi/sdk";
|
|
3
|
-
//#region src/core/tasks/helpers/resolvePermit2Support.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Whether this step should use the Permit2 signature flow.
|
|
6
5
|
*
|
|
@@ -21,6 +20,4 @@ import { TransactionMethodType } from "@lifi/sdk";
|
|
|
21
20
|
* one spender while the sign task routes to the other — turning a needless
|
|
22
21
|
* approval into a revert.
|
|
23
22
|
*/
|
|
24
|
-
export declare const resolvePermit2Support: (context: EthereumStepExecutorContext, strategy: TransactionMethodType) => Promise<boolean>;
|
|
25
|
-
//#endregion
|
|
26
|
-
//# sourceMappingURL=resolvePermit2Support.d.ts.map
|
|
23
|
+
export declare const resolvePermit2Support: (context: EthereumStepExecutorContext, strategy: TransactionMethodType) => Promise<boolean>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_permits_canAccountUsePermit2 = require("../../../permits/canAccountUsePermit2.js");
|
|
3
3
|
const require_core_tasks_helpers_hasPermit2AllowanceInFlight = require("./hasPermit2AllowanceInFlight.js");
|
|
4
|
-
|
|
4
|
+
// src/core/tasks/helpers/resolvePermit2Support.ts
|
|
5
5
|
/**
|
|
6
6
|
* Cheap, synchronous part of the gate: does the step/chain combination allow
|
|
7
7
|
* the Permit2 flow at all? Permit2 should not be available for atomic batch.
|
|
@@ -42,7 +42,6 @@ const resolvePermit2Support = async (context, strategy) => {
|
|
|
42
42
|
});
|
|
43
43
|
return context.permit2SignerSupported;
|
|
44
44
|
};
|
|
45
|
-
//#endregion
|
|
46
45
|
exports.resolvePermit2Support = resolvePermit2Support;
|
|
47
46
|
|
|
48
47
|
//# sourceMappingURL=resolvePermit2Support.js.map
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
import { LiFiStepExtended, StatusManager } from "@lifi/sdk";
|
|
2
|
-
|
|
3
|
-
export declare const shouldCheckForAllowance: (step: LiFiStepExtended, isBridgeExecution: boolean, isFromNativeToken: boolean, statusManager: StatusManager) => boolean;
|
|
4
|
-
//#endregion
|
|
5
|
-
//# sourceMappingURL=shouldCheckForAllowance.d.ts.map
|
|
2
|
+
export declare const shouldCheckForAllowance: (step: LiFiStepExtended, isBridgeExecution: boolean, isFromNativeToken: boolean, statusManager: StatusManager) => boolean;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let _lifi_sdk = require("@lifi/sdk");
|
|
3
|
-
|
|
3
|
+
// src/core/tasks/helpers/shouldCheckForAllowance.ts
|
|
4
4
|
const shouldCheckForAllowance = (step, isBridgeExecution, isFromNativeToken, statusManager) => {
|
|
5
|
+
if ((0, _lifi_sdk.isGaslessStep)(step)) return false;
|
|
5
6
|
const exchangeActionType = isBridgeExecution ? "CROSS_CHAIN" : "SWAP";
|
|
6
7
|
const swapOrBridgeAction = statusManager.findAction(step, exchangeActionType);
|
|
7
8
|
return !(0, _lifi_sdk.hasOpenTransaction)(swapOrBridgeAction) && !isFromNativeToken && !!step.estimate.approvalAddress && !step.estimate.skipApproval;
|
|
8
9
|
};
|
|
9
|
-
//#endregion
|
|
10
10
|
exports.shouldCheckForAllowance = shouldCheckForAllowance;
|
|
11
11
|
|
|
12
12
|
//# sourceMappingURL=shouldCheckForAllowance.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shouldCheckForAllowance.js","names":["hasOpenTransaction"],"sources":["../../../../../src/core/tasks/helpers/shouldCheckForAllowance.ts"],"sourcesContent":["import {\n hasOpenTransaction,\n type LiFiStepExtended,\n type StatusManager,\n} from '@lifi/sdk'\n\nexport const shouldCheckForAllowance = (\n step: LiFiStepExtended,\n isBridgeExecution: boolean,\n isFromNativeToken: boolean,\n statusManager: StatusManager\n): boolean => {\n const exchangeActionType = isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'\n\n const swapOrBridgeAction = statusManager.findAction(step, exchangeActionType)\n\n return (\n // No swap/bridge transaction (hash, batch/relay id or stored bytes) that may\n // still land. A FAILED action with a final outcome does not count, so the\n // allowance is checked again before the new transaction.\n !hasOpenTransaction(swapOrBridgeAction) &&\n // Token is not native (address is not zero)\n !isFromNativeToken &&\n // Approval address is required for allowance checks, but may be null in special cases (e.g. direct transfers)\n !!step.estimate.approvalAddress &&\n !step.estimate.skipApproval\n )\n}\n"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"shouldCheckForAllowance.js","names":["isGaslessStep","hasOpenTransaction"],"sources":["../../../../../src/core/tasks/helpers/shouldCheckForAllowance.ts"],"sourcesContent":["import {\n hasOpenTransaction,\n isGaslessStep,\n type LiFiStepExtended,\n type StatusManager,\n} from '@lifi/sdk'\n\nexport const shouldCheckForAllowance = (\n step: LiFiStepExtended,\n isBridgeExecution: boolean,\n isFromNativeToken: boolean,\n statusManager: StatusManager\n): boolean => {\n // The relayer handles the allowance of a gasless step: the backend signs it\n // in as a `Permit` companion or uses the Permit2 allowance the account has.\n // An approve or an SDK permit here would cost the user gas they do not have.\n if (isGaslessStep(step)) {\n return false\n }\n\n const exchangeActionType = isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'\n\n const swapOrBridgeAction = statusManager.findAction(step, exchangeActionType)\n\n return (\n // No swap/bridge transaction (hash, batch/relay id or stored bytes) that may\n // still land. A FAILED action with a final outcome does not count, so the\n // allowance is checked again before the new transaction.\n !hasOpenTransaction(swapOrBridgeAction) &&\n // Token is not native (address is not zero)\n !isFromNativeToken &&\n // Approval address is required for allowance checks, but may be null in special cases (e.g. direct transfers)\n !!step.estimate.approvalAddress &&\n !step.estimate.skipApproval\n )\n}\n"],"mappings":";;;AAOA,MAAa,2BACX,MACA,mBACA,mBACA,kBACY;CAIZ,KAAA,GAAIA,UAAAA,cAAAA,CAAc,IAAI,GACpB,OAAO;CAGT,MAAM,qBAAqB,oBAAoB,gBAAgB;CAE/D,MAAM,qBAAqB,cAAc,WAAW,MAAM,kBAAkB;CAE5E,OAIE,EAAA,GAACC,UAAAA,mBAAAA,CAAmB,kBAAkB,KAEtC,CAAC,qBAED,CAAC,CAAC,KAAK,SAAS,mBAChB,CAAC,KAAK,SAAS;AAEnB"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../../types.js";
|
|
2
2
|
import { SignedTypedData, TypedData } from "@lifi/sdk";
|
|
3
|
-
//#region src/core/tasks/helpers/signHyperliquidTypedData.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* `beforeSignature` runs right before each signature, the agent's included,
|
|
6
5
|
* after every await before it; it throws to stop the signing.
|
|
7
6
|
*/
|
|
8
|
-
export declare const signHyperliquidTypedData: (context: EthereumStepExecutorContext, allowanceTypedData: TypedData[], beforeSignature?: () => void) => Promise<SignedTypedData[] | undefined>;
|
|
9
|
-
//#endregion
|
|
10
|
-
//# sourceMappingURL=signHyperliquidTypedData.d.ts.map
|
|
7
|
+
export declare const signHyperliquidTypedData: (context: EthereumStepExecutorContext, allowanceTypedData: TypedData[], beforeSignature?: () => void) => Promise<SignedTypedData[] | undefined>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_hyperliquid_agentWallet = require("../../../hyperliquid/agentWallet.js");
|
|
3
|
+
const require_hyperliquid_isHyperliquidAgentStep = require("../../../hyperliquid/isHyperliquidAgentStep.js");
|
|
2
4
|
const require_utils_getDomainChainId = require("../../../utils/getDomainChainId.js");
|
|
3
5
|
const require_utils_isValidSignature = require("../../../utils/isValidSignature.js");
|
|
4
|
-
const require_hyperliquid_isHyperliquidAgentStep = require("../../../hyperliquid/isHyperliquidAgentStep.js");
|
|
5
|
-
const require_hyperliquid_agentWallet = require("../../../hyperliquid/agentWallet.js");
|
|
6
6
|
let viem_actions = require("viem/actions");
|
|
7
7
|
let viem_utils = require("viem/utils");
|
|
8
|
-
|
|
8
|
+
// src/core/tasks/helpers/signHyperliquidTypedData.ts
|
|
9
9
|
/**
|
|
10
10
|
* `beforeSignature` runs right before each signature, the agent's included,
|
|
11
11
|
* after every await before it; it throws to stop the signing.
|
|
@@ -72,7 +72,6 @@ const signHyperliquidTypedData = async (context, allowanceTypedData, beforeSigna
|
|
|
72
72
|
}
|
|
73
73
|
return signedResults;
|
|
74
74
|
};
|
|
75
|
-
//#endregion
|
|
76
75
|
exports.signHyperliquidTypedData = signHyperliquidTypedData;
|
|
77
76
|
|
|
78
77
|
//# sourceMappingURL=signHyperliquidTypedData.js.map
|