@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,7 +1,6 @@
|
|
|
1
1
|
import { WalletCallReceipt as WalletCallReceipt$1 } from "../types.js";
|
|
2
2
|
import { LiFiStep, SDKClient } from "@lifi/sdk";
|
|
3
3
|
import { Hash } from "viem";
|
|
4
|
-
//#region src/actions/waitForRelayedTransactionReceipt.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Polls the relayer until the relayed transaction is done or has failed.
|
|
7
6
|
*
|
|
@@ -11,9 +10,8 @@ import { Hash } from "viem";
|
|
|
11
10
|
* @param timeout - How long to wait for a result in milliseconds. Defaults to 24 hours.
|
|
12
11
|
* @param signal - Ends the wait: no status request starts after it aborts, and the request in flight and the sleep end at once.
|
|
13
12
|
* @returns The receipt of the relayed transaction.
|
|
14
|
-
* @throws {TransactionError} If the transaction failed, was not found, or no result arrived before the timeout. Only the failed transaction is a final outcome.
|
|
13
|
+
* @throws {TransactionError} If the transaction failed, the status was not found after five status errors in a row, or no result arrived before the timeout. Only the failed transaction is a final outcome.
|
|
15
14
|
* @throws The abort reason of `signal` once it aborts.
|
|
16
15
|
*/
|
|
17
16
|
export declare const waitForRelayedTransactionReceipt: (client: SDKClient, taskId: Hash, step: LiFiStep, timeout?: number, signal?: AbortSignal) => Promise<WalletCallReceipt$1>;
|
|
18
|
-
//#endregion
|
|
19
17
|
//# sourceMappingURL=waitForRelayedTransactionReceipt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waitForRelayedTransactionReceipt.d.ts","names":["WalletCallReceipt"],"sources":["../../../src/actions/waitForRelayedTransactionReceipt.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"waitForRelayedTransactionReceipt.d.ts","names":["WalletCallReceipt"],"sources":["../../../src/actions/waitForRelayedTransactionReceipt.ts"],"mappings":";;;;;;;;;;;;;;;qBA0Da,mCACX,QAAQ,WACR,QAAQ,MACR,MAAM,UACN,kBACA,SAAS,gBACR,QAAQA"}
|
|
@@ -1,5 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { getPublicClient } from "../client/publicClient.js";
|
|
2
|
+
import { LiFiErrorCode, TransactionError, getRelayedTransactionStatus, getStatus, isGaslessStep, waitForResult } from "@lifi/sdk";
|
|
3
|
+
import { getTransactionReceipt } from "viem/actions";
|
|
4
|
+
import { getAction } from "viem/utils";
|
|
5
|
+
// src/actions/waitForRelayedTransactionReceipt.ts
|
|
6
|
+
/**
|
|
7
|
+
* Status errors in a row that end the wait. A failed request, `NOT_FOUND`, the
|
|
8
|
+
* 422/1004 answer of a failed lookup and a source receipt that cannot be
|
|
9
|
+
* loaded each count; a PENDING answer resets the count, so a long relay does
|
|
10
|
+
* not collect errors over its whole wait.
|
|
11
|
+
*/
|
|
12
|
+
const MAX_STATUS_ERRORS = 5;
|
|
13
|
+
/** The on-chain outcome of a source transaction, or `undefined` when its receipt cannot be loaded. */
|
|
14
|
+
const getSourceOutcome = async (client, chainId, hash) => {
|
|
15
|
+
try {
|
|
16
|
+
const publicClient = await getPublicClient(client, chainId);
|
|
17
|
+
return (await getAction(publicClient, getTransactionReceipt, "getTransactionReceipt")({ hash })).status;
|
|
18
|
+
} catch {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
3
22
|
/**
|
|
4
23
|
* Polls the relayer until the relayed transaction is done or has failed.
|
|
5
24
|
*
|
|
@@ -9,40 +28,59 @@ import { LiFiErrorCode, TransactionError, getRelayedTransactionStatus, waitForRe
|
|
|
9
28
|
* @param timeout - How long to wait for a result in milliseconds. Defaults to 24 hours.
|
|
10
29
|
* @param signal - Ends the wait: no status request starts after it aborts, and the request in flight and the sleep end at once.
|
|
11
30
|
* @returns The receipt of the relayed transaction.
|
|
12
|
-
* @throws {TransactionError} If the transaction failed, was not found, or no result arrived before the timeout. Only the failed transaction is a final outcome.
|
|
31
|
+
* @throws {TransactionError} If the transaction failed, the status was not found after five status errors in a row, or no result arrived before the timeout. Only the failed transaction is a final outcome.
|
|
13
32
|
* @throws The abort reason of `signal` once it aborts.
|
|
14
33
|
*/
|
|
15
34
|
const waitForRelayedTransactionReceipt = async (client, taskId, step, timeout = 864e5, signal) => {
|
|
16
35
|
const startTime = Date.now();
|
|
36
|
+
const isGasless = isGaslessStep(step);
|
|
37
|
+
const isCrossChain = step.action.fromChainId !== step.action.toChainId;
|
|
38
|
+
let statusErrors = 0;
|
|
17
39
|
return waitForResult(async () => {
|
|
18
40
|
if (Date.now() - startTime > timeout) throw new TransactionError(LiFiErrorCode.TransactionFailed, "Relayed transaction timed out waiting for a result.");
|
|
19
|
-
const result = await getRelayedTransactionStatus(client, {
|
|
41
|
+
const result = await (isGasless ? getStatus(client, { taskId }, { signal }) : getRelayedTransactionStatus(client, {
|
|
20
42
|
taskId,
|
|
21
43
|
fromChain: step.action.fromChainId,
|
|
22
44
|
toChain: step.action.toChainId,
|
|
23
45
|
...step.tool !== "custom" && { bridge: step.tool }
|
|
24
|
-
}, { signal }).catch((e) => {
|
|
46
|
+
}, { signal })).catch((e) => {
|
|
25
47
|
if (process.env.NODE_ENV === "development" && !signal?.aborted) console.debug("Fetching status from relayer failed.", e);
|
|
26
48
|
});
|
|
49
|
+
const gaslessStatus = isGasless ? result : void 0;
|
|
50
|
+
const bridgeSource = isCrossChain && gaslessStatus?.sending?.txHash ? {
|
|
51
|
+
status: "success",
|
|
52
|
+
transactionHash: gaslessStatus.sending.txHash,
|
|
53
|
+
transactionLink: gaslessStatus.sending.txLink
|
|
54
|
+
} : void 0;
|
|
55
|
+
const statusError = (error) => {
|
|
56
|
+
statusErrors++;
|
|
57
|
+
if (statusErrors < MAX_STATUS_ERRORS) return;
|
|
58
|
+
throw error;
|
|
59
|
+
};
|
|
27
60
|
switch (result?.status) {
|
|
28
|
-
case "PENDING":
|
|
61
|
+
case "PENDING":
|
|
62
|
+
statusErrors = 0;
|
|
63
|
+
return gaslessStatus?.substatus === "WAIT_DESTINATION_TRANSACTION" ? bridgeSource : void 0;
|
|
29
64
|
case "DONE": {
|
|
30
65
|
const sending = result?.transactionStatus?.sending || result?.sending;
|
|
31
66
|
return {
|
|
32
67
|
status: "success",
|
|
33
68
|
gasUsed: sending?.gasUsed,
|
|
34
|
-
transactionHash: result?.metadata
|
|
69
|
+
transactionHash: result?.metadata?.txHash || sending?.txHash,
|
|
35
70
|
transactionLink: sending?.txLink
|
|
36
71
|
};
|
|
37
72
|
}
|
|
38
|
-
case "FAILED":
|
|
39
|
-
|
|
73
|
+
case "FAILED":
|
|
74
|
+
if (bridgeSource) {
|
|
75
|
+
const outcome = await getSourceOutcome(client, step.action.fromChainId, bridgeSource.transactionHash);
|
|
76
|
+
if (outcome === "success") return bridgeSource;
|
|
77
|
+
if (outcome === void 0) return statusError(new TransactionError(LiFiErrorCode.TransactionFailed, "The relayed transaction failed, and its source transaction could not be checked."));
|
|
78
|
+
}
|
|
79
|
+
throw new TransactionError(LiFiErrorCode.TransactionFailed, "Transaction was reverted.", void 0, { final: true });
|
|
80
|
+
default: return statusError(new TransactionError(LiFiErrorCode.TransactionNotFound, "Transaction not found."));
|
|
40
81
|
}
|
|
41
|
-
}, 5e3,
|
|
42
|
-
return !(error instanceof TransactionError && error.code === LiFiErrorCode.TransactionFailed);
|
|
43
|
-
}, signal);
|
|
82
|
+
}, 5e3, void 0, () => false, signal);
|
|
44
83
|
};
|
|
45
|
-
//#endregion
|
|
46
84
|
export { waitForRelayedTransactionReceipt };
|
|
47
85
|
|
|
48
86
|
//# sourceMappingURL=waitForRelayedTransactionReceipt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waitForRelayedTransactionReceipt.js","names":[],"sources":["../../../src/actions/waitForRelayedTransactionReceipt.ts"],"sourcesContent":["import type { SDKClient } from '@lifi/sdk'\nimport {\n type ExtendedTransactionInfo,\n type FullStatusData,\n getRelayedTransactionStatus,\n LiFiErrorCode,\n type LiFiStep,\n TransactionError,\n waitForResult,\n} from '@lifi/sdk'\nimport type { Hash } from 'viem'\nimport type { WalletCallReceipt } from '../types.js'\n\n/**\n * Polls the relayer until the relayed transaction is done or has failed.\n *\n * @param client - {@link SDKClient}\n * @param taskId - The relayer task id.\n * @param step - The step the task belongs to.\n * @param timeout - How long to wait for a result in milliseconds. Defaults to 24 hours.\n * @param signal - Ends the wait: no status request starts after it aborts, and the request in flight and the sleep end at once.\n * @returns The receipt of the relayed transaction.\n * @throws {TransactionError} If the transaction failed, was not found, or no result arrived before the timeout. Only the failed transaction is a final outcome.\n * @throws The abort reason of `signal` once it aborts.\n */\nexport const waitForRelayedTransactionReceipt = async (\n client: SDKClient,\n taskId: Hash,\n step: LiFiStep,\n timeout: number = 3_600_000 * 24,\n signal?: AbortSignal\n): Promise<WalletCallReceipt> => {\n const startTime = Date.now()\n return waitForResult(\n async () => {\n // Without this check, a task that stays PENDING is polled forever:\n // PENDING is
|
|
1
|
+
{"version":3,"file":"waitForRelayedTransactionReceipt.js","names":[],"sources":["../../../src/actions/waitForRelayedTransactionReceipt.ts"],"sourcesContent":["import type { SDKClient } from '@lifi/sdk'\nimport {\n type ExtendedTransactionInfo,\n type FullStatusData,\n getRelayedTransactionStatus,\n getStatus,\n isGaslessStep,\n LiFiErrorCode,\n type LiFiStep,\n type RelayStatusResponseData,\n TransactionError,\n waitForResult,\n} from '@lifi/sdk'\nimport type { Hash } from 'viem'\nimport { getTransactionReceipt } from 'viem/actions'\nimport { getAction } from 'viem/utils'\nimport { getPublicClient } from '../client/publicClient.js'\nimport type { WalletCallReceipt } from '../types.js'\n\n/**\n * Status errors in a row that end the wait. A failed request, `NOT_FOUND`, the\n * 422/1004 answer of a failed lookup and a source receipt that cannot be\n * loaded each count; a PENDING answer resets the count, so a long relay does\n * not collect errors over its whole wait.\n */\nconst MAX_STATUS_ERRORS = 5\n\n/** The on-chain outcome of a source transaction, or `undefined` when its receipt cannot be loaded. */\nconst getSourceOutcome = async (\n client: SDKClient,\n chainId: number,\n hash: Hash\n): Promise<'success' | 'reverted' | undefined> => {\n try {\n const publicClient = await getPublicClient(client, chainId)\n const receipt = await getAction(\n publicClient,\n getTransactionReceipt,\n 'getTransactionReceipt'\n )({ hash })\n return receipt.status\n } catch {\n return undefined\n }\n}\n\n/**\n * Polls the relayer until the relayed transaction is done or has failed.\n *\n * @param client - {@link SDKClient}\n * @param taskId - The relayer task id.\n * @param step - The step the task belongs to.\n * @param timeout - How long to wait for a result in milliseconds. Defaults to 24 hours.\n * @param signal - Ends the wait: no status request starts after it aborts, and the request in flight and the sleep end at once.\n * @returns The receipt of the relayed transaction.\n * @throws {TransactionError} If the transaction failed, the status was not found after five status errors in a row, or no result arrived before the timeout. Only the failed transaction is a final outcome.\n * @throws The abort reason of `signal` once it aborts.\n */\nexport const waitForRelayedTransactionReceipt = async (\n client: SDKClient,\n taskId: Hash,\n step: LiFiStep,\n timeout: number = 3_600_000 * 24,\n signal?: AbortSignal\n): Promise<WalletCallReceipt> => {\n const startTime = Date.now()\n const isGasless = isGaslessStep(step)\n const isCrossChain = step.action.fromChainId !== step.action.toChainId\n let statusErrors = 0\n return waitForResult(\n async () => {\n // Without this check, a task that stays PENDING is polled forever:\n // PENDING is no status error, so the error limit does not apply. An\n // error the poll throws ends it. Not final:\n // the relayer may still execute the task, so the action keeps its task\n // id and a resume waits for it again instead of signing a new one.\n if (Date.now() - startTime > timeout) {\n throw new TransactionError(\n LiFiErrorCode.TransactionFailed,\n 'Relayed transaction timed out waiting for a result.'\n )\n }\n\n // A gasless task id is a hash like a 1inch `Order` task id, so the step\n // selects the endpoint. The task id alone routes a gasless request: a\n // `bridge` would let a proxy such as the Jumper backend answer it with\n // its own order lookup. The cast is the one `getRelayedTransactionStatus`\n // makes for the Hyperliquid answer of the same endpoint.\n const result = await (\n isGasless\n ? (getStatus(\n client,\n { taskId },\n { signal }\n ) as unknown as Promise<RelayStatusResponseData>)\n : getRelayedTransactionStatus(\n client,\n {\n taskId,\n fromChain: step.action.fromChainId,\n toChain: step.action.toChainId,\n ...(step.tool !== 'custom' && { bridge: step.tool }),\n },\n { signal }\n )\n ).catch((e) => {\n // A request that the abort ended is no failure of the relayer.\n if (process.env.NODE_ENV === 'development' && !signal?.aborted) {\n console.debug('Fetching status from relayer failed.', e)\n }\n return undefined\n })\n\n // A gasless answer is the transfer status of `/v1/status`: it reports\n // the relayed source transaction in `sending` once the relayer sent it.\n // Only a bridge transfer ends the wait at its source; on one chain the\n // relayed transaction is the whole transfer.\n const gaslessStatus = isGasless\n ? (result as unknown as FullStatusData | undefined)\n : undefined\n const bridgeSource =\n isCrossChain && gaslessStatus?.sending?.txHash\n ? ({\n status: 'success',\n transactionHash: gaslessStatus.sending.txHash,\n transactionLink: gaslessStatus.sending.txLink,\n } as unknown as WalletCallReceipt)\n : undefined\n\n const statusError = (error: TransactionError): undefined => {\n statusErrors++\n if (statusErrors < MAX_STATUS_ERRORS) {\n return undefined\n }\n throw error\n }\n\n switch (result?.status) {\n case 'PENDING':\n statusErrors = 0\n // A gasless bridge transfer whose source transaction landed waits for\n // its destination. The source wait ends here, so a later bridge\n // failure reaches the status task, not the FAILED below.\n return gaslessStatus?.substatus === 'WAIT_DESTINATION_TRANSACTION'\n ? bridgeSource\n : undefined\n case 'DONE': {\n const sending: ExtendedTransactionInfo | undefined =\n (result?.transactionStatus?.sending as ExtendedTransactionInfo) ||\n ((result as unknown as FullStatusData)\n ?.sending as ExtendedTransactionInfo)\n return {\n status: 'success',\n gasUsed: sending?.gasUsed,\n transactionHash: result?.metadata?.txHash || sending?.txHash,\n transactionLink: sending?.txLink,\n } as unknown as WalletCallReceipt\n }\n case 'FAILED':\n // FAILED with a hash is mostly a relayed source transaction that\n // reverted and moved nothing, so a resume may sign again. A bridge\n // can also fail after its source landed: the tokens left the wallet,\n // and a resume must not sign and relay a second transfer. The status\n // task follows that transfer, as for any bridge. The source receipt\n // tells the two apart.\n if (bridgeSource) {\n const outcome = await getSourceOutcome(\n client,\n step.action.fromChainId,\n bridgeSource.transactionHash\n )\n if (outcome === 'success') {\n return bridgeSource\n }\n if (outcome === undefined) {\n // The node may not have the receipt yet, so this counts as a\n // status error. Not final: a resume waits for the same task and\n // checks again.\n return statusError(\n new TransactionError(\n LiFiErrorCode.TransactionFailed,\n 'The relayed transaction failed, and its source transaction could not be checked.'\n )\n )\n }\n }\n throw new TransactionError(\n LiFiErrorCode.TransactionFailed,\n 'Transaction was reverted.',\n undefined,\n { final: true }\n )\n default:\n return statusError(\n new TransactionError(\n LiFiErrorCode.TransactionNotFound,\n 'Transaction not found.'\n )\n )\n }\n },\n 5000,\n undefined,\n // The poll counts its own status errors, so every error it throws ends\n // the wait.\n () => false,\n signal\n )\n}\n"],"mappings":";;;;;;;;;;;AAyBA,MAAM,oBAAoB;;AAG1B,MAAM,mBAAmB,OACvB,QACA,SACA,SACgD;CAChD,IAAI;EACF,MAAM,eAAe,MAAM,gBAAgB,QAAQ,OAAO;EAM1D,QAAO,MALe,UACpB,cACA,uBACA,uBACF,CAAC,CAAC,EAAE,KAAK,CAAC,EAAA,CACK;CACjB,QAAQ;EACN;CACF;AACF;;;;;;;;;;;;;AAcA,MAAa,mCAAmC,OAC9C,QACA,QACA,MACA,UAAkB,OAClB,WAC+B;CAC/B,MAAM,YAAY,KAAK,IAAI;CAC3B,MAAM,YAAY,cAAc,IAAI;CACpC,MAAM,eAAe,KAAK,OAAO,gBAAgB,KAAK,OAAO;CAC7D,IAAI,eAAe;CACnB,OAAO,cACL,YAAY;EAMV,IAAI,KAAK,IAAI,IAAI,YAAY,SAC3B,MAAM,IAAI,iBACR,cAAc,mBACd,qDACF;EAQF,MAAM,SAAS,OACb,YACK,UACC,QACA,EAAE,OAAO,GACT,EAAE,OAAO,CACX,IACA,4BACE,QACA;GACE;GACA,WAAW,KAAK,OAAO;GACvB,SAAS,KAAK,OAAO;GACrB,GAAI,KAAK,SAAS,YAAY,EAAE,QAAQ,KAAK,KAAK;EACpD,GACA,EAAE,OAAO,CACX,EAAA,CACJ,OAAO,MAAM;GAEb,IAAI,QAAQ,IAAI,aAAa,iBAAiB,CAAC,QAAQ,SACrD,QAAQ,MAAM,wCAAwC,CAAC;EAG3D,CAAC;EAMD,MAAM,gBAAgB,YACjB,SACD,KAAA;EACJ,MAAM,eACJ,gBAAgB,eAAe,SAAS,SACnC;GACC,QAAQ;GACR,iBAAiB,cAAc,QAAQ;GACvC,iBAAiB,cAAc,QAAQ;EACzC,IACA,KAAA;EAEN,MAAM,eAAe,UAAuC;GAC1D;GACA,IAAI,eAAe,mBACjB;GAEF,MAAM;EACR;EAEA,QAAQ,QAAQ,QAAhB;GACE,KAAK;IACH,eAAe;IAIf,OAAO,eAAe,cAAc,iCAChC,eACA,KAAA;GACN,KAAK,QAAQ;IACX,MAAM,UACH,QAAQ,mBAAmB,WAC1B,QACE;IACN,OAAO;KACL,QAAQ;KACR,SAAS,SAAS;KAClB,iBAAiB,QAAQ,UAAU,UAAU,SAAS;KACtD,iBAAiB,SAAS;IAC5B;GACF;GACA,KAAK;IAOH,IAAI,cAAc;KAChB,MAAM,UAAU,MAAM,iBACpB,QACA,KAAK,OAAO,aACZ,aAAa,eACf;KACA,IAAI,YAAY,WACd,OAAO;KAET,IAAI,YAAY,KAAA,GAId,OAAO,YACL,IAAI,iBACF,cAAc,mBACd,kFACF,CACF;IAEJ;IACA,MAAM,IAAI,iBACR,cAAc,mBACd,6BACA,KAAA,GACA,EAAE,OAAO,KAAK,CAChB;GACF,SACE,OAAO,YACL,IAAI,iBACF,cAAc,qBACd,wBACF,CACF;EACJ;CACF,GACA,KACA,KAAA,SAGM,OACN,MACF;AACF"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SDKClient } from "@lifi/sdk";
|
|
2
2
|
import { Address, Hash } from "viem";
|
|
3
|
-
//#region src/actions/waitForSafeTransactionExecution.d.ts
|
|
4
3
|
export interface WaitForSafeTransactionExecutionProps {
|
|
5
4
|
chainId: number;
|
|
6
5
|
safeAddress: Address;
|
|
@@ -18,5 +17,4 @@ export interface WaitForSafeTransactionExecutionProps {
|
|
|
18
17
|
* @throws {TransactionError} If the transaction fails, is replaced, or polling times out.
|
|
19
18
|
*/
|
|
20
19
|
export declare function waitForSafeTransactionExecution(client: SDKClient, { chainId, safeAddress, signature, pollingInterval, timeout: timeoutMs }: WaitForSafeTransactionExecutionProps): Promise<Hash>;
|
|
21
|
-
//#endregion
|
|
22
20
|
//# sourceMappingURL=waitForSafeTransactionExecution.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waitForSafeTransactionExecution.d.ts","names":[],"sources":["../../../src/actions/waitForSafeTransactionExecution.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"waitForSafeTransactionExecution.d.ts","names":[],"sources":["../../../src/actions/waitForSafeTransactionExecution.ts"],"mappings":";;iBAUiB;EACf;EACA,aAAa;EACb;EACA;EACA;;;;;;;;;;;wBAYoB,gCACpB,QAAQ,aAEN,SACA,aACA,WACA,iBACA,SAAS,aACR,uCACF,QAAQ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getSafeApiKey } from "../utils/getSafeApiKey.js";
|
|
2
1
|
import { getSafeClient } from "../client/safeClient.js";
|
|
2
|
+
import { getSafeApiKey } from "../utils/getSafeApiKey.js";
|
|
3
3
|
import { LiFiErrorCode, TransactionError, waitForResult } from "@lifi/sdk";
|
|
4
|
-
|
|
4
|
+
// src/actions/waitForSafeTransactionExecution.ts
|
|
5
5
|
/**
|
|
6
6
|
* Polls the Safe Transaction Service until the transaction matching the given signature
|
|
7
7
|
* is executed, then resolves with the on-chain transaction hash.
|
|
@@ -48,7 +48,6 @@ async function waitForSafeTransactionExecution(client, { chainId, safeAddress, s
|
|
|
48
48
|
throw new TransactionError(LiFiErrorCode.TransactionFailed, "Safe transaction timed out waiting for execution.");
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
//#endregion
|
|
52
51
|
export { waitForSafeTransactionExecution };
|
|
53
52
|
|
|
54
53
|
//# sourceMappingURL=waitForSafeTransactionExecution.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ChainId, SDKClient } from "@lifi/sdk";
|
|
2
2
|
import { Chain, Client, Hash, ReplacementReturnType, TransactionReceipt } from "viem";
|
|
3
|
-
//#region src/actions/waitForTransactionReceipt.d.ts
|
|
4
3
|
interface WaitForTransactionReceiptProps {
|
|
5
4
|
client: Client;
|
|
6
5
|
chainId: ChainId;
|
|
@@ -8,6 +7,5 @@ interface WaitForTransactionReceiptProps {
|
|
|
8
7
|
onReplaced?: (response: ReplacementReturnType<Chain | undefined>) => void;
|
|
9
8
|
}
|
|
10
9
|
export declare function waitForTransactionReceipt(client: SDKClient, { client: viemClient, chainId, txHash, onReplaced }: WaitForTransactionReceiptProps): Promise<TransactionReceipt | undefined>;
|
|
11
|
-
//#endregion
|
|
12
10
|
export {};
|
|
13
11
|
//# sourceMappingURL=waitForTransactionReceipt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waitForTransactionReceipt.d.ts","names":[],"sources":["../../../src/actions/waitForTransactionReceipt.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"waitForTransactionReceipt.d.ts","names":[],"sources":["../../../src/actions/waitForTransactionReceipt.ts"],"mappings":";;UAiBU;EACR,QAAQ;EACR,SAAS;EACT,QAAQ;EACR,cAAc,UAAU,sBAAsB;;wBAG1B,0BACpB,QAAQ,aAEN,QAAQ,YACR,SACA,QACA,cACC,iCACF,QAAQ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getPublicClient } from "../client/publicClient.js";
|
|
2
2
|
import { LiFiErrorCode, TransactionError } from "@lifi/sdk";
|
|
3
3
|
import { waitForTransactionReceipt as waitForTransactionReceipt$1 } from "viem/actions";
|
|
4
|
-
|
|
4
|
+
// src/actions/waitForTransactionReceipt.ts
|
|
5
5
|
async function waitForTransactionReceipt(client, { client: viemClient, chainId, txHash, onReplaced }) {
|
|
6
6
|
let { transactionReceipt, replacementReason } = await waitForReceipt(viemClient, txHash, onReplaced);
|
|
7
7
|
if (!transactionReceipt?.status) {
|
|
@@ -30,7 +30,6 @@ async function waitForReceipt(client, txHash, onReplaced) {
|
|
|
30
30
|
replacementReason
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
//#endregion
|
|
34
33
|
export { waitForTransactionReceipt };
|
|
35
34
|
|
|
36
35
|
//# sourceMappingURL=waitForTransactionReceipt.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SDKClient } from "@lifi/sdk";
|
|
2
2
|
import { Client } from "viem";
|
|
3
|
-
//#region src/client/publicClient.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Get an instance of a provider for a specific chain
|
|
6
5
|
* @param client - The SDK client
|
|
@@ -8,5 +7,4 @@ import { Client } from "viem";
|
|
|
8
7
|
* @returns The public client for the given chain
|
|
9
8
|
*/
|
|
10
9
|
export declare const getPublicClient: (client: SDKClient, chainId: number) => Promise<Client>;
|
|
11
|
-
//#endregion
|
|
12
10
|
//# sourceMappingURL=publicClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publicClient.d.ts","names":[],"sources":["../../../src/client/publicClient.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"publicClient.d.ts","names":[],"sources":["../../../src/client/publicClient.ts"],"mappings":";;;;;;;;qBAkBa,kBACX,QAAQ,WACR,oBACC,QAAQ"}
|
|
@@ -2,7 +2,7 @@ import { UNS_PROXY_READER_ADDRESSES } from "../actions/constants.js";
|
|
|
2
2
|
import { ChainId, ChainType } from "@lifi/sdk";
|
|
3
3
|
import { createClient, fallback, http, webSocket } from "viem";
|
|
4
4
|
import { mainnet } from "viem/chains";
|
|
5
|
-
|
|
5
|
+
// src/client/publicClient.ts
|
|
6
6
|
const publicClients = /* @__PURE__ */ new Map();
|
|
7
7
|
/**
|
|
8
8
|
* Get an instance of a provider for a specific chain
|
|
@@ -51,7 +51,6 @@ const buildPublicClient = async (client, chainId) => {
|
|
|
51
51
|
batch: { multicall: true }
|
|
52
52
|
});
|
|
53
53
|
};
|
|
54
|
-
//#endregion
|
|
55
54
|
export { getPublicClient };
|
|
56
55
|
|
|
57
56
|
//# sourceMappingURL=publicClient.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SafeInfo, SafeMultisigTransaction, SafeMultisigTransactionList } from "./types.js";
|
|
2
2
|
import { Address, Hash } from "viem";
|
|
3
|
-
//#region src/client/safeClient.d.ts
|
|
4
3
|
export interface SafeClientInterface {
|
|
5
4
|
getInfo: (address: Address) => Promise<SafeInfo>;
|
|
6
5
|
getTransaction: (safeTxHash: Hash) => Promise<SafeMultisigTransaction>;
|
|
@@ -11,5 +10,4 @@ export interface SafeClientInterface {
|
|
|
11
10
|
}
|
|
12
11
|
export declare const getSafeClient: (chainId: number, apiKey?: string) => SafeClientInterface;
|
|
13
12
|
export type SafeClient = ReturnType<typeof getSafeClient>;
|
|
14
|
-
//#endregion
|
|
15
13
|
//# sourceMappingURL=safeClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safeClient.d.ts","names":[],"sources":["../../../src/client/safeClient.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"safeClient.d.ts","names":[],"sources":["../../../src/client/safeClient.ts"],"mappings":";;iBAoEiB;EACf,UAAU,SAAS,YAAY,QAAQ;EACvC,iBAAiB,YAAY,SAAS,QAAQ;EAC9C,kBACE,aAAa,SACb;IAAY;IAAoB;QAC7B,QAAQ;;qBAGF,gBACX,iBACA,oBACC;YA+BS,aAAa,kBAAkB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LruMap } from "@lifi/sdk";
|
|
2
|
-
|
|
2
|
+
// src/client/safeClient.ts
|
|
3
3
|
const SAFE_CLIENT_GATEWAY = "https://safe-client.safe.global";
|
|
4
4
|
const TX_SERVICE_URL_CACHE_TTL = 36e5;
|
|
5
5
|
const txServiceUrlCache = new LruMap(12);
|
|
@@ -37,7 +37,6 @@ const getSafeClient = (chainId, apiKey) => ({
|
|
|
37
37
|
return request(chainId, `/api/v1/safes/${safeAddress}/multisig-transactions/${qs ? `?${qs}` : ""}`, apiKey);
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
|
-
//#endregion
|
|
41
40
|
export { getSafeClient };
|
|
42
41
|
|
|
43
42
|
//# sourceMappingURL=safeClient.js.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/client/types.d.ts
|
|
2
1
|
export interface SafeInfo {
|
|
3
2
|
threshold: number;
|
|
4
3
|
owners: string[];
|
|
@@ -17,5 +16,4 @@ export interface SafeMultisigTransactionList {
|
|
|
17
16
|
count: number;
|
|
18
17
|
results: SafeMultisigTransaction[];
|
|
19
18
|
}
|
|
20
|
-
//#endregion
|
|
21
19
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/client/types.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/client/types.ts"],"mappings":"A,iBAAiB;EACf;EACA;;iBAGe;EACf;EACA;EACA;EACA;EACA;EACA,gBAAgB;IAAQ;;;iBAGT;EACf;EACA,SAAS"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../types.js";
|
|
2
2
|
import { BaseStepExecutor, ExecuteStepRetryError, ExecuteStepRetryParams, ExecutionAction, LiFiStepExtended, SDKError, StepExecutorBaseContext, StepExecutorOptions, TaskPipeline } from "@lifi/sdk";
|
|
3
3
|
import { Client } from "viem";
|
|
4
|
-
//#region src/core/EthereumStepExecutor.d.ts
|
|
5
4
|
interface EthereumStepExecutorOptions extends StepExecutorOptions {
|
|
6
5
|
client: Client;
|
|
7
6
|
switchChain?: (chainId: number) => Promise<Client | undefined>;
|
|
@@ -19,6 +18,5 @@ export declare class EthereumStepExecutor extends BaseStepExecutor {
|
|
|
19
18
|
override createContext: (baseContext: StepExecutorBaseContext) => Promise<EthereumStepExecutorContext>;
|
|
20
19
|
override createPipeline: (context: EthereumStepExecutorContext) => TaskPipeline;
|
|
21
20
|
}
|
|
22
|
-
//#endregion
|
|
23
21
|
export {};
|
|
24
22
|
//# sourceMappingURL=EthereumStepExecutor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumStepExecutor.d.ts","names":[],"sources":["../../../src/core/EthereumStepExecutor.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthereumStepExecutor.d.ts","names":[],"sources":["../../../src/core/EthereumStepExecutor.ts"],"mappings":";;;UAsCU,oCAAoC;EAC5C,QAAQ;EACR,eAAe,oBAAoB,QAAQ;EAC3C;;qBAGW,6BAA6B;UAChC;UACA;UACA;UACA;EAER,YAAY,SAAS;UAOb;WAOC,cACP,OAAO,OACP,OAAO,kBACP,SAAS,iBACT,cAAc,2BACb,QAAQ,WAAW;EAItB,cACE,MAAM,kBACN,2BACC,QAAQ;WAgCF,gBACP,aAAa,4BACZ,QAAQ;WA0BF,iBACP,SAAS,gCACR"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { isZeroAddress } from "../utils/isZeroAddress.js";
|
|
2
1
|
import { parseEthereumErrors } from "../errors/parseEthereumErrors.js";
|
|
2
|
+
import { isZeroAddress } from "../utils/isZeroAddress.js";
|
|
3
|
+
import { EthereumCheckAllowanceAfterPrepareTask } from "./tasks/EthereumCheckAllowanceAfterPrepareTask.js";
|
|
3
4
|
import { EthereumCheckAllowanceTask } from "./tasks/EthereumCheckAllowanceTask.js";
|
|
4
5
|
import { EthereumCheckBalanceTask } from "./tasks/EthereumCheckBalanceTask.js";
|
|
5
6
|
import { EthereumCheckPermitsTask } from "./tasks/EthereumCheckPermitsTask.js";
|
|
@@ -16,7 +17,7 @@ import { switchChain } from "./tasks/helpers/switchChain.js";
|
|
|
16
17
|
import { BaseStepExecutor, LiFiErrorCode, TaskPipeline, TransactionError, createDefaultStorage, hasOpenTransaction } from "@lifi/sdk";
|
|
17
18
|
import { getAddresses } from "viem/actions";
|
|
18
19
|
import { getAction } from "viem/utils";
|
|
19
|
-
|
|
20
|
+
// src/core/EthereumStepExecutor.ts
|
|
20
21
|
var EthereumStepExecutor = class extends BaseStepExecutor {
|
|
21
22
|
client;
|
|
22
23
|
switchChain;
|
|
@@ -67,6 +68,7 @@ var EthereumStepExecutor = class extends BaseStepExecutor {
|
|
|
67
68
|
new EthereumCheckBalanceTask(),
|
|
68
69
|
new EthereumPermit2AllowanceTask(),
|
|
69
70
|
new EthereumPrepareTransactionTask(),
|
|
71
|
+
new EthereumCheckAllowanceAfterPrepareTask(),
|
|
70
72
|
new EthereumSignAndExecuteTask(),
|
|
71
73
|
new EthereumWaitForTransactionTask(),
|
|
72
74
|
new EthereumWaitForTransactionStatusTask()
|
|
@@ -84,7 +86,6 @@ var EthereumStepExecutor = class extends BaseStepExecutor {
|
|
|
84
86
|
return new TaskPipeline(tasksToRun);
|
|
85
87
|
};
|
|
86
88
|
};
|
|
87
|
-
//#endregion
|
|
88
89
|
export { EthereumStepExecutor };
|
|
89
90
|
|
|
90
91
|
//# sourceMappingURL=EthereumStepExecutor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumStepExecutor.js","names":[],"sources":["../../../src/core/EthereumStepExecutor.ts"],"sourcesContent":["import {\n BaseStepExecutor,\n createDefaultStorage,\n type ExecuteStepRetryError,\n type ExecuteStepRetryParams,\n type ExecutionAction,\n hasOpenTransaction,\n LiFiErrorCode,\n type LiFiStepExtended,\n type SDKClient,\n type SDKError,\n type SDKStorage,\n type StepExecutorBaseContext,\n type StepExecutorOptions,\n TaskPipeline,\n TransactionError,\n} from '@lifi/sdk'\nimport type { Client, GetAddressesReturnType } from 'viem'\nimport { getAddresses } from 'viem/actions'\nimport { getAction } from 'viem/utils'\nimport { parseEthereumErrors } from '../errors/parseEthereumErrors.js'\nimport type { EthereumStepExecutorContext } from '../types.js'\nimport { isZeroAddress } from '../utils/isZeroAddress.js'\nimport { EthereumCheckAllowanceTask } from './tasks/EthereumCheckAllowanceTask.js'\nimport { EthereumCheckBalanceTask } from './tasks/EthereumCheckBalanceTask.js'\nimport { EthereumCheckPermitsTask } from './tasks/EthereumCheckPermitsTask.js'\nimport { EthereumNativePermitTask } from './tasks/EthereumNativePermitTask.js'\nimport { EthereumPermit2AllowanceTask } from './tasks/EthereumPermit2AllowanceTask.js'\nimport { EthereumPrepareTransactionTask } from './tasks/EthereumPrepareTransactionTask.js'\nimport { EthereumResetAllowanceTask } from './tasks/EthereumResetAllowanceTask.js'\nimport { EthereumSetAllowanceTask } from './tasks/EthereumSetAllowanceTask.js'\nimport { EthereumSignAndExecuteTask } from './tasks/EthereumSignAndExecuteTask.js'\nimport { EthereumWaitForTransactionStatusTask } from './tasks/EthereumWaitForTransactionStatusTask.js'\nimport { EthereumWaitForTransactionTask } from './tasks/EthereumWaitForTransactionTask.js'\nimport { shouldCheckForAllowance } from './tasks/helpers/shouldCheckForAllowance.js'\nimport { switchChain } from './tasks/helpers/switchChain.js'\n\ninterface EthereumStepExecutorOptions extends StepExecutorOptions {\n client: Client\n switchChain?: (chainId: number) => Promise<Client | undefined>\n disableMessageSigning?: boolean\n}\n\nexport class EthereumStepExecutor extends BaseStepExecutor {\n private client: Client\n private switchChain?: (chainId: number) => Promise<Client | undefined>\n private storage?: SDKStorage\n private disableMessageSigning?: boolean\n\n constructor(options: EthereumStepExecutorOptions) {\n super(options)\n this.client = options.client\n this.switchChain = options.switchChain\n this.disableMessageSigning = options.disableMessageSigning\n }\n\n private getStorage = (client: SDKClient): SDKStorage => {\n if (!this.storage) {\n this.storage = client.config.storage ?? createDefaultStorage()\n }\n return this.storage\n }\n\n override parseErrors = (\n error: Error,\n step?: LiFiStepExtended,\n action?: ExecutionAction,\n retryParams?: ExecuteStepRetryParams\n ): Promise<SDKError | ExecuteStepRetryError> =>\n parseEthereumErrors(error, step, action, retryParams)\n\n // Ensure that we are using the right chain and wallet when executing transactions.\n checkClient = async (\n step: LiFiStepExtended,\n targetChainId?: number\n ): Promise<Client | undefined> => {\n const updatedClient = await switchChain(\n this.client,\n targetChainId ?? step.action.fromChainId,\n this.allowUserInteraction,\n this.switchChain\n )\n if (updatedClient) {\n this.client = updatedClient\n }\n\n // Prevent execution of the quote by wallet different from the one which requested the quote\n let accountAddress = this.client.account?.address\n if (!accountAddress) {\n const accountAddresses = (await getAction(\n this.client,\n getAddresses,\n 'getAddresses'\n )(undefined)) as GetAddressesReturnType\n accountAddress = accountAddresses?.[0]\n }\n if (\n accountAddress?.toLowerCase() !== step.action.fromAddress?.toLowerCase()\n ) {\n throw new TransactionError(\n LiFiErrorCode.WalletChangedDuringExecution,\n 'The wallet address that requested the quote does not match the wallet address attempting to sign the transaction.'\n )\n }\n return updatedClient\n }\n\n override createContext = async (\n baseContext: StepExecutorBaseContext\n ): Promise<EthereumStepExecutorContext> => {\n const { step, fromChain } = baseContext\n\n const isFromNativeToken =\n fromChain.nativeToken.address === step.action.fromToken.address &&\n isZeroAddress(step.action.fromToken.address)\n\n // Check if message signing is disabled - useful for smart contract wallets\n // We also disable message signing for custom steps\n const disableMessageSigning =\n !!this.disableMessageSigning || step.type !== 'lifi'\n\n return {\n ...baseContext,\n isFromNativeToken,\n disableMessageSigning,\n ethereumClient: this.client,\n checkClient: this.checkClient,\n getStorage: this.getStorage,\n // Signed typed data for native permits and other messages\n signedTypedData: [],\n // Calls for atomic batch transactions (EIP-5792)\n calls: [],\n }\n }\n\n override createPipeline = (\n context: EthereumStepExecutorContext\n ): TaskPipeline => {\n const { step, isBridgeExecution, isFromNativeToken } = context\n\n const tasks = [\n new EthereumCheckPermitsTask(),\n new EthereumCheckAllowanceTask(),\n new EthereumNativePermitTask(),\n new EthereumResetAllowanceTask(),\n new EthereumSetAllowanceTask(),\n new EthereumCheckBalanceTask(),\n new EthereumPermit2AllowanceTask(),\n new EthereumPrepareTransactionTask(),\n new EthereumSignAndExecuteTask(),\n new EthereumWaitForTransactionTask(),\n new EthereumWaitForTransactionStatusTask(),\n ]\n\n const doCheckAllowance = shouldCheckForAllowance(\n step,\n isBridgeExecution,\n isFromNativeToken,\n this.statusManager\n )\n\n let firstTask:\n | typeof EthereumCheckPermitsTask\n | typeof EthereumCheckBalanceTask\n | typeof EthereumWaitForTransactionTask\n | typeof EthereumWaitForTransactionStatusTask\n if (doCheckAllowance) {\n firstTask = EthereumCheckPermitsTask\n } else {\n const swapOrBridgeAction = this.statusManager.findAction(\n step,\n isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'\n )\n // Same predicate as the pre-sign guard: an open transaction is waited\n // for, a FAILED action with a final outcome signs again.\n firstTask = hasOpenTransaction(swapOrBridgeAction)\n ? swapOrBridgeAction?.status === 'DONE'\n ? EthereumWaitForTransactionStatusTask\n : EthereumWaitForTransactionTask\n : EthereumCheckBalanceTask\n }\n\n // Compare classes, not names: a minifier can give two task classes the\n // same name.\n const firstTaskIndex = tasks.findIndex(\n (task) => task.constructor === firstTask\n )\n if (firstTaskIndex === -1) {\n throw new TransactionError(\n LiFiErrorCode.InternalError,\n 'EthereumStepExecutor.createPipeline: first task not found'\n )\n }\n\n const tasksToRun = tasks.slice(firstTaskIndex)\n\n return new TaskPipeline(tasksToRun)\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthereumStepExecutor.js","names":[],"sources":["../../../src/core/EthereumStepExecutor.ts"],"sourcesContent":["import {\n BaseStepExecutor,\n createDefaultStorage,\n type ExecuteStepRetryError,\n type ExecuteStepRetryParams,\n type ExecutionAction,\n hasOpenTransaction,\n LiFiErrorCode,\n type LiFiStepExtended,\n type SDKClient,\n type SDKError,\n type SDKStorage,\n type StepExecutorBaseContext,\n type StepExecutorOptions,\n TaskPipeline,\n TransactionError,\n} from '@lifi/sdk'\nimport type { Client, GetAddressesReturnType } from 'viem'\nimport { getAddresses } from 'viem/actions'\nimport { getAction } from 'viem/utils'\nimport { parseEthereumErrors } from '../errors/parseEthereumErrors.js'\nimport type { EthereumStepExecutorContext } from '../types.js'\nimport { isZeroAddress } from '../utils/isZeroAddress.js'\nimport { EthereumCheckAllowanceAfterPrepareTask } from './tasks/EthereumCheckAllowanceAfterPrepareTask.js'\nimport { EthereumCheckAllowanceTask } from './tasks/EthereumCheckAllowanceTask.js'\nimport { EthereumCheckBalanceTask } from './tasks/EthereumCheckBalanceTask.js'\nimport { EthereumCheckPermitsTask } from './tasks/EthereumCheckPermitsTask.js'\nimport { EthereumNativePermitTask } from './tasks/EthereumNativePermitTask.js'\nimport { EthereumPermit2AllowanceTask } from './tasks/EthereumPermit2AllowanceTask.js'\nimport { EthereumPrepareTransactionTask } from './tasks/EthereumPrepareTransactionTask.js'\nimport { EthereumResetAllowanceTask } from './tasks/EthereumResetAllowanceTask.js'\nimport { EthereumSetAllowanceTask } from './tasks/EthereumSetAllowanceTask.js'\nimport { EthereumSignAndExecuteTask } from './tasks/EthereumSignAndExecuteTask.js'\nimport { EthereumWaitForTransactionStatusTask } from './tasks/EthereumWaitForTransactionStatusTask.js'\nimport { EthereumWaitForTransactionTask } from './tasks/EthereumWaitForTransactionTask.js'\nimport { shouldCheckForAllowance } from './tasks/helpers/shouldCheckForAllowance.js'\nimport { switchChain } from './tasks/helpers/switchChain.js'\n\ninterface EthereumStepExecutorOptions extends StepExecutorOptions {\n client: Client\n switchChain?: (chainId: number) => Promise<Client | undefined>\n disableMessageSigning?: boolean\n}\n\nexport class EthereumStepExecutor extends BaseStepExecutor {\n private client: Client\n private switchChain?: (chainId: number) => Promise<Client | undefined>\n private storage?: SDKStorage\n private disableMessageSigning?: boolean\n\n constructor(options: EthereumStepExecutorOptions) {\n super(options)\n this.client = options.client\n this.switchChain = options.switchChain\n this.disableMessageSigning = options.disableMessageSigning\n }\n\n private getStorage = (client: SDKClient): SDKStorage => {\n if (!this.storage) {\n this.storage = client.config.storage ?? createDefaultStorage()\n }\n return this.storage\n }\n\n override parseErrors = (\n error: Error,\n step?: LiFiStepExtended,\n action?: ExecutionAction,\n retryParams?: ExecuteStepRetryParams\n ): Promise<SDKError | ExecuteStepRetryError> =>\n parseEthereumErrors(error, step, action, retryParams)\n\n // Ensure that we are using the right chain and wallet when executing transactions.\n checkClient = async (\n step: LiFiStepExtended,\n targetChainId?: number\n ): Promise<Client | undefined> => {\n const updatedClient = await switchChain(\n this.client,\n targetChainId ?? step.action.fromChainId,\n this.allowUserInteraction,\n this.switchChain\n )\n if (updatedClient) {\n this.client = updatedClient\n }\n\n // Prevent execution of the quote by wallet different from the one which requested the quote\n let accountAddress = this.client.account?.address\n if (!accountAddress) {\n const accountAddresses = (await getAction(\n this.client,\n getAddresses,\n 'getAddresses'\n )(undefined)) as GetAddressesReturnType\n accountAddress = accountAddresses?.[0]\n }\n if (\n accountAddress?.toLowerCase() !== step.action.fromAddress?.toLowerCase()\n ) {\n throw new TransactionError(\n LiFiErrorCode.WalletChangedDuringExecution,\n 'The wallet address that requested the quote does not match the wallet address attempting to sign the transaction.'\n )\n }\n return updatedClient\n }\n\n override createContext = async (\n baseContext: StepExecutorBaseContext\n ): Promise<EthereumStepExecutorContext> => {\n const { step, fromChain } = baseContext\n\n const isFromNativeToken =\n fromChain.nativeToken.address === step.action.fromToken.address &&\n isZeroAddress(step.action.fromToken.address)\n\n // Check if message signing is disabled - useful for smart contract wallets\n // We also disable message signing for custom steps\n const disableMessageSigning =\n !!this.disableMessageSigning || step.type !== 'lifi'\n\n return {\n ...baseContext,\n isFromNativeToken,\n disableMessageSigning,\n ethereumClient: this.client,\n checkClient: this.checkClient,\n getStorage: this.getStorage,\n // Signed typed data for native permits and other messages\n signedTypedData: [],\n // Calls for atomic batch transactions (EIP-5792)\n calls: [],\n }\n }\n\n override createPipeline = (\n context: EthereumStepExecutorContext\n ): TaskPipeline => {\n const { step, isBridgeExecution, isFromNativeToken } = context\n\n const tasks = [\n new EthereumCheckPermitsTask(),\n new EthereumCheckAllowanceTask(),\n new EthereumNativePermitTask(),\n new EthereumResetAllowanceTask(),\n new EthereumSetAllowanceTask(),\n new EthereumCheckBalanceTask(),\n new EthereumPermit2AllowanceTask(),\n new EthereumPrepareTransactionTask(),\n new EthereumCheckAllowanceAfterPrepareTask(),\n new EthereumSignAndExecuteTask(),\n new EthereumWaitForTransactionTask(),\n new EthereumWaitForTransactionStatusTask(),\n ]\n\n const doCheckAllowance = shouldCheckForAllowance(\n step,\n isBridgeExecution,\n isFromNativeToken,\n this.statusManager\n )\n\n let firstTask:\n | typeof EthereumCheckPermitsTask\n | typeof EthereumCheckBalanceTask\n | typeof EthereumWaitForTransactionTask\n | typeof EthereumWaitForTransactionStatusTask\n if (doCheckAllowance) {\n firstTask = EthereumCheckPermitsTask\n } else {\n const swapOrBridgeAction = this.statusManager.findAction(\n step,\n isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'\n )\n // Same predicate as the pre-sign guard: an open transaction is waited\n // for, a FAILED action with a final outcome signs again.\n firstTask = hasOpenTransaction(swapOrBridgeAction)\n ? swapOrBridgeAction?.status === 'DONE'\n ? EthereumWaitForTransactionStatusTask\n : EthereumWaitForTransactionTask\n : EthereumCheckBalanceTask\n }\n\n // Compare classes, not names: a minifier can give two task classes the\n // same name.\n const firstTaskIndex = tasks.findIndex(\n (task) => task.constructor === firstTask\n )\n if (firstTaskIndex === -1) {\n throw new TransactionError(\n LiFiErrorCode.InternalError,\n 'EthereumStepExecutor.createPipeline: first task not found'\n )\n }\n\n const tasksToRun = tasks.slice(firstTaskIndex)\n\n return new TaskPipeline(tasksToRun)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4CA,IAAa,uBAAb,cAA0C,iBAAiB;CACjD;CACA;CACA;CACA;CAER,YAAY,SAAsC;EAChD,MAAM,OAAO;EACb,KAAK,SAAS,QAAQ;EACtB,KAAK,cAAc,QAAQ;EAC3B,KAAK,wBAAwB,QAAQ;CACvC;CAEQ,cAAc,WAAkC;EACtD,IAAI,CAAC,KAAK,SACR,KAAK,UAAU,OAAO,OAAO,WAAW,qBAAqB;EAE/D,OAAO,KAAK;CACd;CAES,eACP,OACA,MACA,QACA,gBAEA,oBAAoB,OAAO,MAAM,QAAQ,WAAW;CAGtD,cAAc,OACZ,MACA,kBACgC;EAChC,MAAM,gBAAgB,MAAM,YAC1B,KAAK,QACL,iBAAiB,KAAK,OAAO,aAC7B,KAAK,sBACL,KAAK,WACP;EACA,IAAI,eACF,KAAK,SAAS;EAIhB,IAAI,iBAAiB,KAAK,OAAO,SAAS;EAC1C,IAAI,CAAC,gBAMH,kBAAiB,MALe,UAC9B,KAAK,QACL,cACA,cACF,CAAC,CAAC,KAAA,CAAS,EAAA,GACyB;EAEtC,IACE,gBAAgB,YAAY,MAAM,KAAK,OAAO,aAAa,YAAY,GAEvE,MAAM,IAAI,iBACR,cAAc,8BACd,mHACF;EAEF,OAAO;CACT;CAES,gBAAgB,OACvB,gBACyC;EACzC,MAAM,EAAE,MAAM,cAAc;EAE5B,MAAM,oBACJ,UAAU,YAAY,YAAY,KAAK,OAAO,UAAU,WACxD,cAAc,KAAK,OAAO,UAAU,OAAO;EAI7C,MAAM,wBACJ,CAAC,CAAC,KAAK,yBAAyB,KAAK,SAAS;EAEhD,OAAO;GACL,GAAG;GACH;GACA;GACA,gBAAgB,KAAK;GACrB,aAAa,KAAK;GAClB,YAAY,KAAK;GAEjB,iBAAiB,CAAC;GAElB,OAAO,CAAC;EACV;CACF;CAES,kBACP,YACiB;EACjB,MAAM,EAAE,MAAM,mBAAmB,sBAAsB;EAEvD,MAAM,QAAQ;GACZ,IAAI,yBAAyB;GAC7B,IAAI,2BAA2B;GAC/B,IAAI,yBAAyB;GAC7B,IAAI,2BAA2B;GAC/B,IAAI,yBAAyB;GAC7B,IAAI,yBAAyB;GAC7B,IAAI,6BAA6B;GACjC,IAAI,+BAA+B;GACnC,IAAI,uCAAuC;GAC3C,IAAI,2BAA2B;GAC/B,IAAI,+BAA+B;GACnC,IAAI,qCAAqC;EAC3C;EAEA,MAAM,mBAAmB,wBACvB,MACA,mBACA,mBACA,KAAK,aACP;EAEA,IAAI;EAKJ,IAAI,kBACF,YAAY;OACP;GACL,MAAM,qBAAqB,KAAK,cAAc,WAC5C,MACA,oBAAoB,gBAAgB,MACtC;GAGA,YAAY,mBAAmB,kBAAkB,IAC7C,oBAAoB,WAAW,SAC7B,uCACA,iCACF;EACN;EAIA,MAAM,iBAAiB,MAAM,WAC1B,SAAS,KAAK,gBAAgB,SACjC;EACA,IAAI,mBAAmB,IACrB,MAAM,IAAI,iBACR,cAAc,eACd,2DACF;EAGF,MAAM,aAAa,MAAM,MAAM,cAAc;EAE7C,OAAO,IAAI,aAAa,UAAU;CACpC;AACF"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
|
-
//#region src/core/tasks/EthereumBatchedSignAndExecuteTask.d.ts
|
|
4
3
|
export declare class EthereumBatchedSignAndExecuteTask extends BaseStepExecutionTask {
|
|
5
4
|
run(context: EthereumStepExecutorContext): Promise<TaskResult>;
|
|
6
5
|
}
|
|
7
|
-
//#endregion
|
|
8
6
|
//# sourceMappingURL=EthereumBatchedSignAndExecuteTask.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumBatchedSignAndExecuteTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumBatchedSignAndExecuteTask.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthereumBatchedSignAndExecuteTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumBatchedSignAndExecuteTask.ts"],"mappings":";;qBAea,0CAA0C;EAC/C,IAAI,SAAS,8BAA8B,QAAQ"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { convertExtendedChain } from "../../utils/convertExtendedChain.js";
|
|
2
|
+
import { getSendChain } from "../../utils/getSendChain.js";
|
|
1
3
|
import { BaseStepExecutionTask, CLEARED_TRANSACTION_FIELDS, LiFiErrorCode, TransactionError, assertNoOpenTransaction } from "@lifi/sdk";
|
|
2
4
|
import { sendCalls } from "viem/actions";
|
|
3
5
|
import { getAction } from "viem/utils";
|
|
4
|
-
|
|
6
|
+
// src/core/tasks/EthereumBatchedSignAndExecuteTask.ts
|
|
5
7
|
var EthereumBatchedSignAndExecuteTask = class extends BaseStepExecutionTask {
|
|
6
8
|
async run(context) {
|
|
7
9
|
const { step, fromChain, statusManager, checkClient, transactionRequest, calls: currentCalls, isBridgeExecution } = context;
|
|
@@ -21,7 +23,8 @@ var EthereumBatchedSignAndExecuteTask = class extends BaseStepExecutionTask {
|
|
|
21
23
|
assertNoOpenTransaction(statusManager.findAction(step, action.type));
|
|
22
24
|
const { id } = await getAction(updatedClient, sendCalls, "sendCalls")({
|
|
23
25
|
account: updatedClient.account,
|
|
24
|
-
calls
|
|
26
|
+
calls,
|
|
27
|
+
chain: getSendChain(updatedClient, convertExtendedChain(fromChain))
|
|
25
28
|
});
|
|
26
29
|
statusManager.updateAction(step, action.type, "PENDING", {
|
|
27
30
|
...CLEARED_TRANSACTION_FIELDS,
|
|
@@ -36,7 +39,6 @@ var EthereumBatchedSignAndExecuteTask = class extends BaseStepExecutionTask {
|
|
|
36
39
|
};
|
|
37
40
|
}
|
|
38
41
|
};
|
|
39
|
-
//#endregion
|
|
40
42
|
export { EthereumBatchedSignAndExecuteTask };
|
|
41
43
|
|
|
42
44
|
//# sourceMappingURL=EthereumBatchedSignAndExecuteTask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumBatchedSignAndExecuteTask.js","names":[],"sources":["../../../../src/core/tasks/EthereumBatchedSignAndExecuteTask.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, Hash, Hex } from 'viem'\nimport { sendCalls } from 'viem/actions'\nimport { getAction } from 'viem/utils'\nimport type { Call, EthereumStepExecutorContext } from '../../types.js'\n\nexport class EthereumBatchedSignAndExecuteTask extends BaseStepExecutionTask {\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n step,\n fromChain,\n statusManager,\n checkClient,\n transactionRequest,\n calls: currentCalls,\n isBridgeExecution,\n } = context\n\n const calls = [...currentCalls]\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 if (!transactionRequest) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Transaction request is not found.'\n )\n }\n\n const transferCall: Call = {\n chainId: fromChain.id,\n data: transactionRequest.data as Hex,\n to: transactionRequest.to as Address,\n value: transactionRequest.value,\n }\n\n calls.push(transferCall)\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).\n assertNoOpenTransaction(statusManager.findAction(step, action.type))\n\n const { id } = await getAction(\n updatedClient,\n sendCalls,\n 'sendCalls'\n )({\n account: updatedClient.account!,\n calls,\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 taskId: id as Hash,\n txType: 'batched',\n callCount: calls.length,\n signedAt: Date.now(),\n })\n\n return { status: 'COMPLETED', context: { calls } }\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthereumBatchedSignAndExecuteTask.js","names":[],"sources":["../../../../src/core/tasks/EthereumBatchedSignAndExecuteTask.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, Hash, Hex } from 'viem'\nimport { sendCalls } from 'viem/actions'\nimport { getAction } from 'viem/utils'\nimport type { Call, EthereumStepExecutorContext } from '../../types.js'\nimport { convertExtendedChain } from '../../utils/convertExtendedChain.js'\nimport { getSendChain } from '../../utils/getSendChain.js'\n\nexport class EthereumBatchedSignAndExecuteTask extends BaseStepExecutionTask {\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n step,\n fromChain,\n statusManager,\n checkClient,\n transactionRequest,\n calls: currentCalls,\n isBridgeExecution,\n } = context\n\n const calls = [...currentCalls]\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 if (!transactionRequest) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Transaction request is not found.'\n )\n }\n\n const transferCall: Call = {\n chainId: fromChain.id,\n data: transactionRequest.data as Hex,\n to: transactionRequest.to as Address,\n value: transactionRequest.value,\n }\n\n calls.push(transferCall)\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).\n assertNoOpenTransaction(statusManager.findAction(step, action.type))\n\n const { id } = await getAction(\n updatedClient,\n sendCalls,\n 'sendCalls'\n )({\n account: updatedClient.account!,\n calls,\n // Without it `sendCalls` uses `client.chain`, which can be stale.\n chain: getSendChain(updatedClient, convertExtendedChain(fromChain)),\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 taskId: id as Hash,\n txType: 'batched',\n callCount: calls.length,\n signedAt: Date.now(),\n })\n\n return { status: 'COMPLETED', context: { calls } }\n }\n}\n"],"mappings":";;;;;;AAeA,IAAa,oCAAb,cAAuD,sBAAsB;CAC3E,MAAM,IAAI,SAA2D;EACnE,MAAM,EACJ,MACA,WACA,eACA,aACA,oBACA,OAAO,cACP,sBACE;EAEJ,MAAM,QAAQ,CAAC,GAAG,YAAY;EAE9B,MAAM,SAAS,cAAc,WAC3B,MACA,oBAAoB,gBAAgB,MACtC;EACA,IAAI,CAAC,QACH,MAAM,IAAI,iBACR,cAAc,uBACd,kDACF;EAIF,MAAM,gBAAgB,MAAM,YAAY,IAAI;EAC5C,IAAI,CAAC,eACH,OAAO,EAAE,QAAQ,SAAS;EAG5B,IAAI,CAAC,oBACH,MAAM,IAAI,iBACR,cAAc,uBACd,kEACF;EAGF,MAAM,eAAqB;GACzB,SAAS,UAAU;GACnB,MAAM,mBAAmB;GACzB,IAAI,mBAAmB;GACvB,OAAO,mBAAmB;EAC5B;EAEA,MAAM,KAAK,YAAY;EAKvB,wBAAwB,cAAc,WAAW,MAAM,OAAO,IAAI,CAAC;EAEnE,MAAM,EAAE,OAAO,MAAM,UACnB,eACA,WACA,WACF,CAAC,CAAC;GACA,SAAS,cAAc;GACvB;GAEA,OAAO,aAAa,eAAe,qBAAqB,SAAS,CAAC;EACpE,CAAC;EAED,cAAc,aAAa,MAAM,OAAO,MAAM,WAAW;GAGvD,GAAG;GACH,QAAQ;GACR,QAAQ;GACR,WAAW,MAAM;GACjB,UAAU,KAAK,IAAI;EACrB,CAAC;EAED,OAAO;GAAE,QAAQ;GAAa,SAAS,EAAE,MAAM;EAAE;CACnD;AACF"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
|
-
//#region src/core/tasks/EthereumBatchedWaitForTransactionTask.d.ts
|
|
4
3
|
export declare class EthereumBatchedWaitForTransactionTask extends BaseStepExecutionTask {
|
|
5
4
|
run(context: EthereumStepExecutorContext): Promise<TaskResult>;
|
|
6
5
|
}
|
|
7
|
-
//#endregion
|
|
8
6
|
//# sourceMappingURL=EthereumBatchedWaitForTransactionTask.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumBatchedWaitForTransactionTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumBatchedWaitForTransactionTask.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthereumBatchedWaitForTransactionTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumBatchedWaitForTransactionTask.ts"],"mappings":";;qBAca,8CAA8C;EACnD,IAAI,SAAS,8BAA8B,QAAQ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { waitForBatchTransactionReceipt } from "../../actions/waitForBatchTransactionReceipt.js";
|
|
2
2
|
import { updateActionWithReceipt } from "./helpers/updateActionWithReceipt.js";
|
|
3
3
|
import { BaseStepExecutionTask, LiFiErrorCode, TransactionError } from "@lifi/sdk";
|
|
4
|
-
|
|
4
|
+
// src/core/tasks/EthereumBatchedWaitForTransactionTask.ts
|
|
5
5
|
var EthereumBatchedWaitForTransactionTask = class extends BaseStepExecutionTask {
|
|
6
6
|
async run(context) {
|
|
7
7
|
const { step, statusManager, fromChain, isBridgeExecution, checkClient } = context;
|
|
@@ -22,7 +22,6 @@ var EthereumBatchedWaitForTransactionTask = class extends BaseStepExecutionTask
|
|
|
22
22
|
return { status: "COMPLETED" };
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
//#endregion
|
|
26
25
|
export { EthereumBatchedWaitForTransactionTask };
|
|
27
26
|
|
|
28
27
|
//# sourceMappingURL=EthereumBatchedWaitForTransactionTask.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { EthereumStepExecutorContext } from "../../types.js";
|
|
2
|
+
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
|
+
/**
|
|
4
|
+
* Runs after PrepareTransaction. Some providers only know the spender once
|
|
5
|
+
* `/stepTransaction` builds the executable transaction, so the routing-time
|
|
6
|
+
* step carries no `estimate.approvalAddress` and the allowance tasks before
|
|
7
|
+
* prepare do not run. When the re-quote brings one, the allowance is read for
|
|
8
|
+
* it, and reset and set only if it falls short, before the transaction is
|
|
9
|
+
* signed.
|
|
10
|
+
*
|
|
11
|
+
* A spender that was already set before prepare is not checked again here.
|
|
12
|
+
*/
|
|
13
|
+
export declare class EthereumCheckAllowanceAfterPrepareTask extends BaseStepExecutionTask {
|
|
14
|
+
private readonly allowancePipeline;
|
|
15
|
+
override shouldRun(context: EthereumStepExecutorContext): Promise<boolean>;
|
|
16
|
+
run(context: EthereumStepExecutorContext): Promise<TaskResult>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=EthereumCheckAllowanceAfterPrepareTask.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EthereumCheckAllowanceAfterPrepareTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumCheckAllowanceAfterPrepareTask.ts"],"mappings":";;;;;;;;;;;;qBAiBa,+CAA+C;mBACzC;WAMF,UACb,SAAS,8BACR;EAIG,IAAI,SAAS,8BAA8B,QAAQ"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { EthereumCheckAllowanceTask } from "./EthereumCheckAllowanceTask.js";
|
|
2
|
+
import { EthereumResetAllowanceTask } from "./EthereumResetAllowanceTask.js";
|
|
3
|
+
import { EthereumSetAllowanceTask } from "./EthereumSetAllowanceTask.js";
|
|
4
|
+
import { hasApprovalAddressAppearedAtPrepare } from "./helpers/hasApprovalAddressAppearedAtPrepare.js";
|
|
5
|
+
import { BaseStepExecutionTask, TaskPipeline } from "@lifi/sdk";
|
|
6
|
+
// src/core/tasks/EthereumCheckAllowanceAfterPrepareTask.ts
|
|
7
|
+
/**
|
|
8
|
+
* Runs after PrepareTransaction. Some providers only know the spender once
|
|
9
|
+
* `/stepTransaction` builds the executable transaction, so the routing-time
|
|
10
|
+
* step carries no `estimate.approvalAddress` and the allowance tasks before
|
|
11
|
+
* prepare do not run. When the re-quote brings one, the allowance is read for
|
|
12
|
+
* it, and reset and set only if it falls short, before the transaction is
|
|
13
|
+
* signed.
|
|
14
|
+
*
|
|
15
|
+
* A spender that was already set before prepare is not checked again here.
|
|
16
|
+
*/
|
|
17
|
+
var EthereumCheckAllowanceAfterPrepareTask = class extends BaseStepExecutionTask {
|
|
18
|
+
allowancePipeline = new TaskPipeline([
|
|
19
|
+
new EthereumCheckAllowanceTask(),
|
|
20
|
+
new EthereumResetAllowanceTask(),
|
|
21
|
+
new EthereumSetAllowanceTask()
|
|
22
|
+
]);
|
|
23
|
+
async shouldRun(context) {
|
|
24
|
+
return hasApprovalAddressAppearedAtPrepare(context);
|
|
25
|
+
}
|
|
26
|
+
async run(context) {
|
|
27
|
+
return this.allowancePipeline.run(context);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
export { EthereumCheckAllowanceAfterPrepareTask };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=EthereumCheckAllowanceAfterPrepareTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EthereumCheckAllowanceAfterPrepareTask.js","names":[],"sources":["../../../../src/core/tasks/EthereumCheckAllowanceAfterPrepareTask.ts"],"sourcesContent":["import { BaseStepExecutionTask, TaskPipeline, type TaskResult } from '@lifi/sdk'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { EthereumCheckAllowanceTask } from './EthereumCheckAllowanceTask.js'\nimport { EthereumResetAllowanceTask } from './EthereumResetAllowanceTask.js'\nimport { EthereumSetAllowanceTask } from './EthereumSetAllowanceTask.js'\nimport { hasApprovalAddressAppearedAtPrepare } from './helpers/hasApprovalAddressAppearedAtPrepare.js'\n\n/**\n * Runs after PrepareTransaction. Some providers only know the spender once\n * `/stepTransaction` builds the executable transaction, so the routing-time\n * step carries no `estimate.approvalAddress` and the allowance tasks before\n * prepare do not run. When the re-quote brings one, the allowance is read for\n * it, and reset and set only if it falls short, before the transaction is\n * signed.\n *\n * A spender that was already set before prepare is not checked again here.\n */\nexport class EthereumCheckAllowanceAfterPrepareTask extends BaseStepExecutionTask {\n private readonly allowancePipeline = new TaskPipeline([\n new EthereumCheckAllowanceTask(),\n new EthereumResetAllowanceTask(),\n new EthereumSetAllowanceTask(),\n ])\n\n override async shouldRun(\n context: EthereumStepExecutorContext\n ): Promise<boolean> {\n return hasApprovalAddressAppearedAtPrepare(context)\n }\n\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n return this.allowancePipeline.run(context)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAiBA,IAAa,yCAAb,cAA4D,sBAAsB;CAC/D,oBAAoB,IAAI,aAAa;EACpD,IAAI,2BAA2B;EAC/B,IAAI,2BAA2B;EAC/B,IAAI,yBAAyB;CAC/B,CAAC;CAED,MAAe,UACb,SACkB;EAClB,OAAO,oCAAoC,OAAO;CACpD;CAEA,MAAM,IAAI,SAA2D;EACnE,OAAO,KAAK,kBAAkB,IAAI,OAAO;CAC3C;AACF"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
|
-
//#region src/core/tasks/EthereumCheckAllowanceTask.d.ts
|
|
4
3
|
export declare class EthereumCheckAllowanceTask extends BaseStepExecutionTask {
|
|
5
4
|
override shouldRun(context: EthereumStepExecutorContext): Promise<boolean>;
|
|
6
5
|
run(context: EthereumStepExecutorContext): Promise<TaskResult>;
|
|
7
6
|
}
|
|
8
|
-
//#endregion
|
|
9
7
|
//# sourceMappingURL=EthereumCheckAllowanceTask.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumCheckAllowanceTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumCheckAllowanceTask.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthereumCheckAllowanceTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumCheckAllowanceTask.ts"],"mappings":";;qBAOa,mCAAmC;WAC/B,UACb,SAAS,8BACR;EAIG,IAAI,SAAS,8BAA8B,QAAQ"}
|