@lifi/sdk-provider-ethereum 4.2.12 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/dist/cjs/EthereumProvider.d.ts +1 -4
- package/dist/cjs/EthereumProvider.js +1 -2
- package/dist/cjs/actions/checkPermitSupport.d.ts +1 -4
- package/dist/cjs/actions/checkPermitSupport.js +5 -6
- package/dist/cjs/actions/checkPermitSupport.js.map +1 -1
- package/dist/cjs/actions/constants.d.ts +1 -4
- package/dist/cjs/actions/constants.js +1 -2
- package/dist/cjs/actions/getAccountCode.d.ts +1 -4
- package/dist/cjs/actions/getAccountCode.js +1 -2
- package/dist/cjs/actions/getAllowance.d.ts +2 -5
- package/dist/cjs/actions/getAllowance.js +6 -7
- package/dist/cjs/actions/getAllowance.js.map +1 -1
- package/dist/cjs/actions/getEthereumBalance.d.ts +1 -4
- package/dist/cjs/actions/getEthereumBalance.js +1 -2
- package/dist/cjs/actions/getMaxPriorityFeePerGas.d.ts +1 -4
- package/dist/cjs/actions/getMaxPriorityFeePerGas.js +3 -4
- package/dist/cjs/actions/getMaxPriorityFeePerGas.js.map +1 -1
- package/dist/cjs/actions/getMulticallAddress.d.ts +1 -4
- package/dist/cjs/actions/getMulticallAddress.js +1 -2
- package/dist/cjs/actions/isBatchingSupported.d.ts +1 -4
- package/dist/cjs/actions/isBatchingSupported.js +1 -2
- package/dist/cjs/actions/isSafeSignature.d.ts +2 -5
- package/dist/cjs/actions/isSafeSignature.js +3 -3
- package/dist/cjs/actions/isSafeSignature.js.map +1 -1
- package/dist/cjs/actions/isSafeWallet.d.ts +1 -4
- package/dist/cjs/actions/isSafeWallet.js +2 -3
- package/dist/cjs/actions/isSmartContractWallet.d.ts +1 -4
- package/dist/cjs/actions/isSmartContractWallet.js +1 -2
- package/dist/cjs/actions/resolveENSAddress.d.ts +1 -4
- package/dist/cjs/actions/resolveENSAddress.js +1 -2
- package/dist/cjs/actions/resolveEthereumAddress.d.ts +1 -4
- package/dist/cjs/actions/resolveEthereumAddress.js +1 -2
- package/dist/cjs/actions/resolveTransactionHash.d.ts +1 -4
- package/dist/cjs/actions/resolveTransactionHash.js +7 -4
- package/dist/cjs/actions/resolveTransactionHash.js.map +1 -1
- package/dist/cjs/actions/resolveUNSAddress.d.ts +1 -4
- package/dist/cjs/actions/resolveUNSAddress.js +2 -3
- package/dist/cjs/actions/setAllowance.d.ts +3 -6
- package/dist/cjs/actions/setAllowance.js +10 -7
- package/dist/cjs/actions/setAllowance.js.map +1 -1
- package/dist/cjs/actions/waitForBatchTransactionReceipt.d.ts +1 -4
- package/dist/cjs/actions/waitForBatchTransactionReceipt.js +1 -2
- package/dist/cjs/actions/waitForRelayedTransactionReceipt.d.ts +2 -5
- package/dist/cjs/actions/waitForRelayedTransactionReceipt.js +50 -12
- package/dist/cjs/actions/waitForRelayedTransactionReceipt.js.map +1 -1
- package/dist/cjs/actions/waitForSafeTransactionExecution.d.ts +1 -4
- package/dist/cjs/actions/waitForSafeTransactionExecution.js +2 -3
- package/dist/cjs/actions/waitForTransactionReceipt.d.ts +1 -4
- package/dist/cjs/actions/waitForTransactionReceipt.js +1 -2
- package/dist/cjs/client/publicClient.d.ts +1 -4
- package/dist/cjs/client/publicClient.js +1 -2
- package/dist/cjs/client/safeClient.d.ts +1 -4
- package/dist/cjs/client/safeClient.js +1 -2
- package/dist/cjs/client/types.d.ts +1 -4
- package/dist/cjs/core/EthereumStepExecutor.d.ts +1 -4
- package/dist/cjs/core/EthereumStepExecutor.js +6 -7
- package/dist/cjs/core/EthereumStepExecutor.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumBatchedSignAndExecuteTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumBatchedSignAndExecuteTask.js +5 -3
- package/dist/cjs/core/tasks/EthereumBatchedSignAndExecuteTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumBatchedWaitForTransactionTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumBatchedWaitForTransactionTask.js +1 -2
- package/dist/cjs/core/tasks/EthereumBatchedWaitForTransactionTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumCheckAllowanceAfterPrepareTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumCheckAllowanceAfterPrepareTask.js +1 -2
- package/dist/cjs/core/tasks/EthereumCheckAllowanceAfterPrepareTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumCheckAllowanceTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumCheckAllowanceTask.js +3 -4
- package/dist/cjs/core/tasks/EthereumCheckAllowanceTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumCheckBalanceTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumCheckBalanceTask.js +3 -3
- package/dist/cjs/core/tasks/EthereumCheckBalanceTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumCheckPermitsTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumCheckPermitsTask.js +2 -3
- package/dist/cjs/core/tasks/EthereumNativePermitTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumNativePermitTask.js +5 -6
- package/dist/cjs/core/tasks/EthereumNativePermitTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumPermit2AllowanceTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumPermit2AllowanceTask.js +1 -2
- package/dist/cjs/core/tasks/EthereumPrepareTransactionTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumPrepareTransactionTask.js +7 -6
- package/dist/cjs/core/tasks/EthereumPrepareTransactionTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumRelayedSignAndExecuteTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumRelayedSignAndExecuteTask.js +3 -4
- package/dist/cjs/core/tasks/EthereumRelayedWaitForTransactionTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumRelayedWaitForTransactionTask.js +2 -3
- package/dist/cjs/core/tasks/EthereumRelayedWaitForTransactionTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumResetAllowanceTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumResetAllowanceTask.js +6 -6
- package/dist/cjs/core/tasks/EthereumResetAllowanceTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumSetAllowanceTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumSetAllowanceTask.js +7 -7
- package/dist/cjs/core/tasks/EthereumSetAllowanceTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumSignAndExecuteTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumSignAndExecuteTask.js +2 -3
- package/dist/cjs/core/tasks/EthereumSignAndExecuteTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumStandardSignAndExecuteTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumStandardSignAndExecuteTask.js +6 -6
- package/dist/cjs/core/tasks/EthereumStandardSignAndExecuteTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumStandardWaitForTransactionTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumStandardWaitForTransactionTask.js +1 -2
- package/dist/cjs/core/tasks/EthereumStandardWaitForTransactionTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumWaitForTransactionStatusTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumWaitForTransactionStatusTask.js +1 -2
- package/dist/cjs/core/tasks/EthereumWaitForTransactionTask.d.ts +1 -4
- package/dist/cjs/core/tasks/EthereumWaitForTransactionTask.js +2 -3
- package/dist/cjs/core/tasks/helpers/estimateTransactionRequest.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/estimateTransactionRequest.js +3 -4
- package/dist/cjs/core/tasks/helpers/estimateTransactionRequest.js.map +1 -1
- package/dist/cjs/core/tasks/helpers/findSignedNativePermit.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/findSignedNativePermit.js +2 -3
- package/dist/cjs/core/tasks/helpers/getApprovalAmount.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/getApprovalAmount.js +2 -3
- package/dist/cjs/core/tasks/helpers/getEthereumExecutionStrategy.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/getEthereumExecutionStrategy.js +6 -4
- package/dist/cjs/core/tasks/helpers/getEthereumExecutionStrategy.js.map +1 -1
- package/dist/cjs/core/tasks/helpers/getTxLink.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/getTxLink.js +1 -2
- package/dist/cjs/core/tasks/helpers/getUpdatedStep.d.ts +10 -5
- package/dist/cjs/core/tasks/helpers/getUpdatedStep.js +11 -20
- package/dist/cjs/core/tasks/helpers/getUpdatedStep.js.map +1 -1
- package/dist/cjs/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.js +1 -2
- package/dist/cjs/core/tasks/helpers/hasPermit2AllowanceInFlight.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/hasPermit2AllowanceInFlight.js +1 -2
- package/dist/cjs/core/tasks/helpers/isAllowancePreparedForAnotherStrategy.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/isAllowancePreparedForAnotherStrategy.js +1 -2
- package/dist/cjs/core/tasks/helpers/isTypedDataAlreadySigned.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/isTypedDataAlreadySigned.js +1 -2
- package/dist/cjs/core/tasks/helpers/preservePermit2Allowances.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/preservePermit2Allowances.js +1 -2
- package/dist/cjs/core/tasks/helpers/resolveAllowanceSpender.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/resolveAllowanceSpender.js +1 -2
- package/dist/cjs/core/tasks/helpers/resolvePermit2Support.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/resolvePermit2Support.js +1 -2
- package/dist/cjs/core/tasks/helpers/shouldCheckForAllowance.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/shouldCheckForAllowance.js +2 -2
- package/dist/cjs/core/tasks/helpers/shouldCheckForAllowance.js.map +1 -1
- package/dist/cjs/core/tasks/helpers/signHyperliquidTypedData.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/signHyperliquidTypedData.js +3 -4
- package/dist/cjs/core/tasks/helpers/signHyperliquidTypedData.js.map +1 -1
- package/dist/cjs/core/tasks/helpers/signTypedDataEntries.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/signTypedDataEntries.js +1 -2
- package/dist/cjs/core/tasks/helpers/signTypedDataEntries.js.map +1 -1
- package/dist/cjs/core/tasks/helpers/switchChain.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/switchChain.js +1 -2
- package/dist/cjs/core/tasks/helpers/updateActionWithReceipt.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/updateActionWithReceipt.js +1 -2
- package/dist/cjs/errors/parseEthereumErrors.d.ts +1 -4
- package/dist/cjs/errors/parseEthereumErrors.js +3 -3
- package/dist/cjs/errors/parseEthereumErrors.js.map +1 -1
- package/dist/cjs/hyperliquid/agentWallet.d.ts +1 -4
- package/dist/cjs/hyperliquid/agentWallet.js +1 -2
- package/dist/cjs/hyperliquid/isHyperliquidAgentStep.d.ts +1 -4
- package/dist/cjs/hyperliquid/isHyperliquidAgentStep.js +1 -2
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +8 -8
- package/dist/cjs/permits/acceptsRawEcdsaSignature.d.ts +1 -4
- package/dist/cjs/permits/acceptsRawEcdsaSignature.js +1 -2
- package/dist/cjs/permits/allowanceTransfer.d.ts +1 -4
- package/dist/cjs/permits/allowanceTransfer.js +1 -2
- package/dist/cjs/permits/allowanceTransfer.js.map +1 -1
- package/dist/cjs/permits/canAccountUseNativePermits.d.ts +1 -4
- package/dist/cjs/permits/canAccountUseNativePermits.js +1 -2
- package/dist/cjs/permits/canAccountUsePermit2.d.ts +1 -4
- package/dist/cjs/permits/canAccountUsePermit2.js +1 -2
- package/dist/cjs/permits/constants.d.ts +1 -4
- package/dist/cjs/permits/constants.js +1 -2
- package/dist/cjs/permits/domain.d.ts +1 -4
- package/dist/cjs/permits/domain.js +1 -2
- package/dist/cjs/permits/encodeNativePermitData.d.ts +1 -4
- package/dist/cjs/permits/encodeNativePermitData.js +1 -2
- package/dist/cjs/permits/encodePermit2Data.d.ts +1 -4
- package/dist/cjs/permits/encodePermit2Data.js +1 -2
- package/dist/cjs/permits/getNativePermit.d.ts +1 -4
- package/dist/cjs/permits/getNativePermit.js +7 -8
- package/dist/cjs/permits/getNativePermit.js.map +1 -1
- package/dist/cjs/permits/getPermitTransferFromValues.d.ts +1 -4
- package/dist/cjs/permits/getPermitTransferFromValues.js +2 -3
- package/dist/cjs/permits/getPermitTransferFromValues.js.map +1 -1
- package/dist/cjs/permits/invariant.d.ts +1 -4
- package/dist/cjs/permits/invariant.js +1 -2
- package/dist/cjs/permits/isDelegationDesignatorCode.d.ts +1 -4
- package/dist/cjs/permits/isDelegationDesignatorCode.js +1 -2
- package/dist/cjs/permits/isNativePermitValid.d.ts +1 -4
- package/dist/cjs/permits/isNativePermitValid.js +2 -3
- package/dist/cjs/permits/isNativePermitValid.js.map +1 -1
- package/dist/cjs/permits/signPermit2Message.d.ts +1 -4
- package/dist/cjs/permits/signPermit2Message.js +1 -2
- package/dist/cjs/permits/signPermit2Message.js.map +1 -1
- package/dist/cjs/permits/signatureTransfer.d.ts +1 -4
- package/dist/cjs/permits/signatureTransfer.js +1 -2
- package/dist/cjs/permits/signatureTransfer.js.map +1 -1
- package/dist/cjs/permits/types.d.ts +1 -4
- package/dist/cjs/types.d.ts +7 -4
- package/dist/cjs/types.js +1 -2
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/utils/abi.d.ts +1 -4
- package/dist/cjs/utils/abi.js +1 -2
- package/dist/cjs/utils/convertExtendedChain.d.ts +1 -4
- package/dist/cjs/utils/convertExtendedChain.js +1 -2
- package/dist/cjs/utils/getActionWithFallback.d.ts +2 -4
- package/dist/cjs/utils/getActionWithFallback.js +3 -4
- package/dist/cjs/utils/getActionWithFallback.js.map +1 -1
- package/dist/cjs/utils/getDomainChainId.d.ts +1 -4
- package/dist/cjs/utils/getDomainChainId.js +1 -2
- package/dist/cjs/utils/getSafeApiKey.d.ts +1 -4
- package/dist/cjs/utils/getSafeApiKey.js +1 -2
- package/dist/cjs/utils/getSendChain.d.ts +2 -0
- package/dist/cjs/utils/getSendChain.js +6 -0
- package/dist/cjs/utils/getSendChain.js.map +1 -0
- package/dist/cjs/utils/getTypedDataLane.d.ts +1 -4
- package/dist/cjs/utils/getTypedDataLane.js +1 -2
- package/dist/cjs/utils/isContractCallStep.d.ts +1 -4
- package/dist/cjs/utils/isContractCallStep.js +1 -2
- package/dist/cjs/utils/isExtendedChain.d.ts +1 -4
- package/dist/cjs/utils/isExtendedChain.js +1 -2
- package/dist/cjs/utils/isGaslessStep.d.ts +8 -4
- package/dist/cjs/utils/isGaslessStep.js +8 -2
- package/dist/cjs/utils/isGaslessStep.js.map +1 -1
- package/dist/cjs/utils/isValidSignature.d.ts +1 -4
- package/dist/cjs/utils/isValidSignature.js +1 -2
- package/dist/cjs/utils/isZeroAddress.d.ts +1 -4
- package/dist/cjs/utils/isZeroAddress.js +1 -2
- package/dist/cjs/utils/median.d.ts +1 -4
- package/dist/cjs/utils/median.js +1 -2
- package/dist/cjs/version.d.ts +1 -4
- package/dist/cjs/version.js +2 -3
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/EthereumProvider.d.ts +0 -2
- package/dist/esm/EthereumProvider.d.ts.map +1 -1
- package/dist/esm/EthereumProvider.js +1 -2
- package/dist/esm/actions/checkPermitSupport.d.ts +0 -2
- package/dist/esm/actions/checkPermitSupport.d.ts.map +1 -1
- package/dist/esm/actions/checkPermitSupport.js +5 -6
- package/dist/esm/actions/checkPermitSupport.js.map +1 -1
- package/dist/esm/actions/constants.d.ts +0 -2
- package/dist/esm/actions/constants.d.ts.map +1 -1
- package/dist/esm/actions/constants.js +1 -2
- package/dist/esm/actions/getAccountCode.d.ts +0 -2
- package/dist/esm/actions/getAccountCode.d.ts.map +1 -1
- package/dist/esm/actions/getAccountCode.js +1 -2
- package/dist/esm/actions/getAllowance.d.ts +1 -3
- package/dist/esm/actions/getAllowance.d.ts.map +1 -1
- package/dist/esm/actions/getAllowance.js +6 -7
- package/dist/esm/actions/getAllowance.js.map +1 -1
- package/dist/esm/actions/getEthereumBalance.d.ts +0 -2
- package/dist/esm/actions/getEthereumBalance.d.ts.map +1 -1
- package/dist/esm/actions/getEthereumBalance.js +1 -2
- package/dist/esm/actions/getMaxPriorityFeePerGas.d.ts +1 -3
- package/dist/esm/actions/getMaxPriorityFeePerGas.d.ts.map +1 -1
- package/dist/esm/actions/getMaxPriorityFeePerGas.js +3 -4
- package/dist/esm/actions/getMaxPriorityFeePerGas.js.map +1 -1
- package/dist/esm/actions/getMulticallAddress.d.ts +0 -2
- package/dist/esm/actions/getMulticallAddress.d.ts.map +1 -1
- package/dist/esm/actions/getMulticallAddress.js +1 -2
- package/dist/esm/actions/isBatchingSupported.d.ts +0 -2
- package/dist/esm/actions/isBatchingSupported.d.ts.map +1 -1
- package/dist/esm/actions/isBatchingSupported.js +1 -2
- package/dist/esm/actions/isSafeSignature.d.ts +1 -3
- package/dist/esm/actions/isSafeSignature.d.ts.map +1 -1
- package/dist/esm/actions/isSafeSignature.js +3 -3
- package/dist/esm/actions/isSafeSignature.js.map +1 -1
- package/dist/esm/actions/isSafeWallet.d.ts +0 -2
- package/dist/esm/actions/isSafeWallet.d.ts.map +1 -1
- package/dist/esm/actions/isSafeWallet.js +2 -3
- package/dist/esm/actions/isSmartContractWallet.d.ts +0 -2
- package/dist/esm/actions/isSmartContractWallet.d.ts.map +1 -1
- package/dist/esm/actions/isSmartContractWallet.js +1 -2
- package/dist/esm/actions/resolveENSAddress.d.ts +0 -2
- package/dist/esm/actions/resolveENSAddress.d.ts.map +1 -1
- package/dist/esm/actions/resolveENSAddress.js +1 -2
- package/dist/esm/actions/resolveEthereumAddress.d.ts +0 -2
- package/dist/esm/actions/resolveEthereumAddress.d.ts.map +1 -1
- package/dist/esm/actions/resolveEthereumAddress.js +1 -2
- package/dist/esm/actions/resolveTransactionHash.d.ts +0 -2
- package/dist/esm/actions/resolveTransactionHash.d.ts.map +1 -1
- package/dist/esm/actions/resolveTransactionHash.js +7 -4
- package/dist/esm/actions/resolveTransactionHash.js.map +1 -1
- package/dist/esm/actions/resolveUNSAddress.d.ts +0 -2
- package/dist/esm/actions/resolveUNSAddress.d.ts.map +1 -1
- package/dist/esm/actions/resolveUNSAddress.js +2 -3
- package/dist/esm/actions/setAllowance.d.ts +2 -4
- package/dist/esm/actions/setAllowance.d.ts.map +1 -1
- package/dist/esm/actions/setAllowance.js +10 -7
- package/dist/esm/actions/setAllowance.js.map +1 -1
- package/dist/esm/actions/waitForBatchTransactionReceipt.d.ts +0 -2
- package/dist/esm/actions/waitForBatchTransactionReceipt.d.ts.map +1 -1
- package/dist/esm/actions/waitForBatchTransactionReceipt.js +1 -2
- package/dist/esm/actions/waitForRelayedTransactionReceipt.d.ts +1 -3
- package/dist/esm/actions/waitForRelayedTransactionReceipt.d.ts.map +1 -1
- package/dist/esm/actions/waitForRelayedTransactionReceipt.js +51 -13
- package/dist/esm/actions/waitForRelayedTransactionReceipt.js.map +1 -1
- package/dist/esm/actions/waitForSafeTransactionExecution.d.ts +0 -2
- package/dist/esm/actions/waitForSafeTransactionExecution.d.ts.map +1 -1
- package/dist/esm/actions/waitForSafeTransactionExecution.js +2 -3
- package/dist/esm/actions/waitForTransactionReceipt.d.ts +0 -2
- package/dist/esm/actions/waitForTransactionReceipt.d.ts.map +1 -1
- package/dist/esm/actions/waitForTransactionReceipt.js +1 -2
- package/dist/esm/client/publicClient.d.ts +0 -2
- package/dist/esm/client/publicClient.d.ts.map +1 -1
- package/dist/esm/client/publicClient.js +1 -2
- package/dist/esm/client/safeClient.d.ts +0 -2
- package/dist/esm/client/safeClient.d.ts.map +1 -1
- package/dist/esm/client/safeClient.js +1 -2
- package/dist/esm/client/types.d.ts +0 -2
- package/dist/esm/client/types.d.ts.map +1 -1
- package/dist/esm/core/EthereumStepExecutor.d.ts +0 -2
- package/dist/esm/core/EthereumStepExecutor.d.ts.map +1 -1
- package/dist/esm/core/EthereumStepExecutor.js +6 -7
- package/dist/esm/core/EthereumStepExecutor.js.map +1 -1
- package/dist/esm/core/tasks/EthereumBatchedSignAndExecuteTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumBatchedSignAndExecuteTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumBatchedSignAndExecuteTask.js +5 -3
- package/dist/esm/core/tasks/EthereumBatchedSignAndExecuteTask.js.map +1 -1
- package/dist/esm/core/tasks/EthereumBatchedWaitForTransactionTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumBatchedWaitForTransactionTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumBatchedWaitForTransactionTask.js +1 -2
- package/dist/esm/core/tasks/EthereumCheckAllowanceAfterPrepareTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumCheckAllowanceAfterPrepareTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumCheckAllowanceAfterPrepareTask.js +1 -2
- package/dist/esm/core/tasks/EthereumCheckAllowanceAfterPrepareTask.js.map +1 -1
- package/dist/esm/core/tasks/EthereumCheckAllowanceTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumCheckAllowanceTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumCheckAllowanceTask.js +3 -4
- package/dist/esm/core/tasks/EthereumCheckAllowanceTask.js.map +1 -1
- package/dist/esm/core/tasks/EthereumCheckBalanceTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumCheckBalanceTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumCheckBalanceTask.js +4 -4
- package/dist/esm/core/tasks/EthereumCheckBalanceTask.js.map +1 -1
- package/dist/esm/core/tasks/EthereumCheckPermitsTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumCheckPermitsTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumCheckPermitsTask.js +2 -3
- package/dist/esm/core/tasks/EthereumNativePermitTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumNativePermitTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumNativePermitTask.js +5 -6
- package/dist/esm/core/tasks/EthereumNativePermitTask.js.map +1 -1
- package/dist/esm/core/tasks/EthereumPermit2AllowanceTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumPermit2AllowanceTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumPermit2AllowanceTask.js +1 -2
- package/dist/esm/core/tasks/EthereumPrepareTransactionTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumPrepareTransactionTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumPrepareTransactionTask.js +8 -7
- package/dist/esm/core/tasks/EthereumPrepareTransactionTask.js.map +1 -1
- package/dist/esm/core/tasks/EthereumRelayedSignAndExecuteTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumRelayedSignAndExecuteTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumRelayedSignAndExecuteTask.js +3 -4
- package/dist/esm/core/tasks/EthereumRelayedWaitForTransactionTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumRelayedWaitForTransactionTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumRelayedWaitForTransactionTask.js +2 -3
- package/dist/esm/core/tasks/EthereumResetAllowanceTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumResetAllowanceTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumResetAllowanceTask.js +6 -6
- package/dist/esm/core/tasks/EthereumResetAllowanceTask.js.map +1 -1
- package/dist/esm/core/tasks/EthereumSetAllowanceTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumSetAllowanceTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumSetAllowanceTask.js +7 -7
- package/dist/esm/core/tasks/EthereumSetAllowanceTask.js.map +1 -1
- package/dist/esm/core/tasks/EthereumSignAndExecuteTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumSignAndExecuteTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumSignAndExecuteTask.js +2 -3
- package/dist/esm/core/tasks/EthereumStandardSignAndExecuteTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumStandardSignAndExecuteTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumStandardSignAndExecuteTask.js +6 -6
- package/dist/esm/core/tasks/EthereumStandardSignAndExecuteTask.js.map +1 -1
- package/dist/esm/core/tasks/EthereumStandardWaitForTransactionTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumStandardWaitForTransactionTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumStandardWaitForTransactionTask.js +1 -2
- package/dist/esm/core/tasks/EthereumWaitForTransactionStatusTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumWaitForTransactionStatusTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumWaitForTransactionStatusTask.js +1 -2
- package/dist/esm/core/tasks/EthereumWaitForTransactionTask.d.ts +0 -2
- package/dist/esm/core/tasks/EthereumWaitForTransactionTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumWaitForTransactionTask.js +2 -3
- package/dist/esm/core/tasks/helpers/estimateTransactionRequest.d.ts +1 -3
- package/dist/esm/core/tasks/helpers/estimateTransactionRequest.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/estimateTransactionRequest.js +3 -4
- package/dist/esm/core/tasks/helpers/estimateTransactionRequest.js.map +1 -1
- package/dist/esm/core/tasks/helpers/findSignedNativePermit.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/findSignedNativePermit.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/findSignedNativePermit.js +2 -3
- package/dist/esm/core/tasks/helpers/getApprovalAmount.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/getApprovalAmount.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/getApprovalAmount.js +2 -3
- package/dist/esm/core/tasks/helpers/getEthereumExecutionStrategy.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/getEthereumExecutionStrategy.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/getEthereumExecutionStrategy.js +6 -4
- package/dist/esm/core/tasks/helpers/getEthereumExecutionStrategy.js.map +1 -1
- package/dist/esm/core/tasks/helpers/getTxLink.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/getTxLink.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/getTxLink.js +1 -2
- package/dist/esm/core/tasks/helpers/getUpdatedStep.d.ts +10 -4
- package/dist/esm/core/tasks/helpers/getUpdatedStep.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/getUpdatedStep.js +12 -21
- package/dist/esm/core/tasks/helpers/getUpdatedStep.js.map +1 -1
- package/dist/esm/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/hasApprovalAddressAppearedAtPrepare.js +1 -2
- package/dist/esm/core/tasks/helpers/hasPermit2AllowanceInFlight.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/hasPermit2AllowanceInFlight.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/hasPermit2AllowanceInFlight.js +1 -2
- package/dist/esm/core/tasks/helpers/isAllowancePreparedForAnotherStrategy.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/isAllowancePreparedForAnotherStrategy.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/isAllowancePreparedForAnotherStrategy.js +1 -2
- package/dist/esm/core/tasks/helpers/isTypedDataAlreadySigned.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/isTypedDataAlreadySigned.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/isTypedDataAlreadySigned.js +1 -2
- package/dist/esm/core/tasks/helpers/preservePermit2Allowances.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/preservePermit2Allowances.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/preservePermit2Allowances.js +1 -2
- package/dist/esm/core/tasks/helpers/resolveAllowanceSpender.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/resolveAllowanceSpender.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/resolveAllowanceSpender.js +1 -2
- package/dist/esm/core/tasks/helpers/resolvePermit2Support.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/resolvePermit2Support.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/resolvePermit2Support.js +1 -2
- package/dist/esm/core/tasks/helpers/shouldCheckForAllowance.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/shouldCheckForAllowance.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/shouldCheckForAllowance.js +3 -3
- package/dist/esm/core/tasks/helpers/shouldCheckForAllowance.js.map +1 -1
- package/dist/esm/core/tasks/helpers/signHyperliquidTypedData.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/signHyperliquidTypedData.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/signHyperliquidTypedData.js +3 -4
- package/dist/esm/core/tasks/helpers/signTypedDataEntries.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/signTypedDataEntries.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/signTypedDataEntries.js +1 -2
- package/dist/esm/core/tasks/helpers/switchChain.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/switchChain.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/switchChain.js +1 -2
- package/dist/esm/core/tasks/helpers/updateActionWithReceipt.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/updateActionWithReceipt.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/updateActionWithReceipt.js +1 -2
- package/dist/esm/errors/parseEthereumErrors.d.ts +0 -2
- package/dist/esm/errors/parseEthereumErrors.d.ts.map +1 -1
- package/dist/esm/errors/parseEthereumErrors.js +4 -4
- package/dist/esm/errors/parseEthereumErrors.js.map +1 -1
- package/dist/esm/hyperliquid/agentWallet.d.ts +0 -2
- package/dist/esm/hyperliquid/agentWallet.d.ts.map +1 -1
- package/dist/esm/hyperliquid/agentWallet.js +1 -2
- package/dist/esm/hyperliquid/isHyperliquidAgentStep.d.ts +0 -2
- package/dist/esm/hyperliquid/isHyperliquidAgentStep.d.ts.map +1 -1
- package/dist/esm/hyperliquid/isHyperliquidAgentStep.js +1 -2
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +8 -8
- package/dist/esm/permits/acceptsRawEcdsaSignature.d.ts +0 -2
- package/dist/esm/permits/acceptsRawEcdsaSignature.d.ts.map +1 -1
- package/dist/esm/permits/acceptsRawEcdsaSignature.js +1 -2
- package/dist/esm/permits/allowanceTransfer.d.ts +0 -2
- package/dist/esm/permits/allowanceTransfer.d.ts.map +1 -1
- package/dist/esm/permits/allowanceTransfer.js +1 -2
- package/dist/esm/permits/allowanceTransfer.js.map +1 -1
- package/dist/esm/permits/canAccountUseNativePermits.d.ts +0 -2
- package/dist/esm/permits/canAccountUseNativePermits.d.ts.map +1 -1
- package/dist/esm/permits/canAccountUseNativePermits.js +1 -2
- package/dist/esm/permits/canAccountUsePermit2.d.ts +0 -2
- package/dist/esm/permits/canAccountUsePermit2.d.ts.map +1 -1
- package/dist/esm/permits/canAccountUsePermit2.js +1 -2
- package/dist/esm/permits/constants.d.ts +0 -2
- package/dist/esm/permits/constants.d.ts.map +1 -1
- package/dist/esm/permits/constants.js +1 -2
- package/dist/esm/permits/domain.d.ts +0 -2
- package/dist/esm/permits/domain.d.ts.map +1 -1
- package/dist/esm/permits/domain.js +1 -2
- package/dist/esm/permits/encodeNativePermitData.d.ts +0 -2
- package/dist/esm/permits/encodeNativePermitData.d.ts.map +1 -1
- package/dist/esm/permits/encodeNativePermitData.js +1 -2
- package/dist/esm/permits/encodePermit2Data.d.ts +0 -2
- package/dist/esm/permits/encodePermit2Data.d.ts.map +1 -1
- package/dist/esm/permits/encodePermit2Data.js +1 -2
- package/dist/esm/permits/getNativePermit.d.ts +0 -2
- package/dist/esm/permits/getNativePermit.d.ts.map +1 -1
- package/dist/esm/permits/getNativePermit.js +7 -8
- package/dist/esm/permits/getNativePermit.js.map +1 -1
- package/dist/esm/permits/getPermitTransferFromValues.d.ts +0 -2
- package/dist/esm/permits/getPermitTransferFromValues.d.ts.map +1 -1
- package/dist/esm/permits/getPermitTransferFromValues.js +2 -3
- package/dist/esm/permits/getPermitTransferFromValues.js.map +1 -1
- package/dist/esm/permits/invariant.d.ts +0 -2
- package/dist/esm/permits/invariant.d.ts.map +1 -1
- package/dist/esm/permits/invariant.js +1 -2
- package/dist/esm/permits/isDelegationDesignatorCode.d.ts +0 -2
- package/dist/esm/permits/isDelegationDesignatorCode.d.ts.map +1 -1
- package/dist/esm/permits/isDelegationDesignatorCode.js +1 -2
- package/dist/esm/permits/isNativePermitValid.d.ts +0 -2
- package/dist/esm/permits/isNativePermitValid.d.ts.map +1 -1
- package/dist/esm/permits/isNativePermitValid.js +2 -3
- package/dist/esm/permits/isNativePermitValid.js.map +1 -1
- package/dist/esm/permits/signPermit2Message.d.ts +0 -2
- package/dist/esm/permits/signPermit2Message.d.ts.map +1 -1
- package/dist/esm/permits/signPermit2Message.js +1 -2
- package/dist/esm/permits/signatureTransfer.d.ts +0 -2
- package/dist/esm/permits/signatureTransfer.d.ts.map +1 -1
- package/dist/esm/permits/signatureTransfer.js +1 -2
- package/dist/esm/permits/types.d.ts +0 -2
- package/dist/esm/permits/types.d.ts.map +1 -1
- package/dist/esm/types.d.ts +6 -2
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/esm/types.js +1 -2
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/utils/abi.d.ts +0 -2
- package/dist/esm/utils/abi.d.ts.map +1 -1
- package/dist/esm/utils/abi.js +1 -2
- package/dist/esm/utils/convertExtendedChain.d.ts +0 -2
- package/dist/esm/utils/convertExtendedChain.d.ts.map +1 -1
- package/dist/esm/utils/convertExtendedChain.js +1 -2
- package/dist/esm/utils/getActionWithFallback.d.ts +2 -3
- package/dist/esm/utils/getActionWithFallback.d.ts.map +1 -1
- package/dist/esm/utils/getActionWithFallback.js +3 -4
- package/dist/esm/utils/getActionWithFallback.js.map +1 -1
- package/dist/esm/utils/getDomainChainId.d.ts +0 -2
- package/dist/esm/utils/getDomainChainId.d.ts.map +1 -1
- package/dist/esm/utils/getDomainChainId.js +1 -2
- package/dist/esm/utils/getSafeApiKey.d.ts +0 -2
- package/dist/esm/utils/getSafeApiKey.d.ts.map +1 -1
- package/dist/esm/utils/getSafeApiKey.js +1 -2
- package/dist/esm/utils/getSendChain.d.ts +3 -0
- package/dist/esm/utils/getSendChain.d.ts.map +1 -0
- package/dist/esm/utils/getSendChain.js +5 -0
- package/dist/esm/utils/getSendChain.js.map +1 -0
- package/dist/esm/utils/getTypedDataLane.d.ts +0 -2
- package/dist/esm/utils/getTypedDataLane.d.ts.map +1 -1
- package/dist/esm/utils/getTypedDataLane.js +1 -2
- package/dist/esm/utils/isContractCallStep.d.ts +0 -2
- package/dist/esm/utils/isContractCallStep.d.ts.map +1 -1
- package/dist/esm/utils/isContractCallStep.js +1 -2
- package/dist/esm/utils/isExtendedChain.d.ts +0 -2
- package/dist/esm/utils/isExtendedChain.d.ts.map +1 -1
- package/dist/esm/utils/isExtendedChain.js +1 -2
- package/dist/esm/utils/isGaslessStep.d.ts +7 -2
- package/dist/esm/utils/isGaslessStep.d.ts.map +1 -1
- package/dist/esm/utils/isGaslessStep.js +8 -2
- package/dist/esm/utils/isGaslessStep.js.map +1 -1
- package/dist/esm/utils/isValidSignature.d.ts +0 -2
- package/dist/esm/utils/isValidSignature.d.ts.map +1 -1
- package/dist/esm/utils/isValidSignature.js +1 -2
- package/dist/esm/utils/isZeroAddress.d.ts +0 -2
- package/dist/esm/utils/isZeroAddress.d.ts.map +1 -1
- package/dist/esm/utils/isZeroAddress.js +1 -2
- package/dist/esm/utils/median.d.ts +0 -2
- package/dist/esm/utils/median.d.ts.map +1 -1
- package/dist/esm/utils/median.js +1 -2
- package/dist/esm/version.d.ts +1 -3
- package/dist/esm/version.d.ts.map +1 -1
- package/dist/esm/version.js +2 -3
- package/dist/esm/version.js.map +1 -1
- package/package.json +3 -3
- package/src/actions/checkPermitSupport.ts +4 -2
- package/src/actions/getAllowance.ts +8 -4
- package/src/actions/getMaxPriorityFeePerGas.ts +4 -2
- package/src/actions/isSafeSignature.ts +3 -3
- package/src/actions/resolveTransactionHash.ts +10 -3
- package/src/actions/setAllowance.ts +31 -6
- package/src/actions/waitForRelayedTransactionReceipt.ts +129 -24
- package/src/core/tasks/EthereumBatchedSignAndExecuteTask.ts +4 -0
- package/src/core/tasks/EthereumCheckAllowanceTask.ts +3 -2
- package/src/core/tasks/EthereumCheckBalanceTask.ts +11 -1
- package/src/core/tasks/EthereumNativePermitTask.ts +2 -1
- package/src/core/tasks/EthereumPrepareTransactionTask.ts +29 -3
- package/src/core/tasks/EthereumResetAllowanceTask.ts +4 -2
- package/src/core/tasks/EthereumSetAllowanceTask.ts +4 -2
- package/src/core/tasks/EthereumStandardSignAndExecuteTask.ts +4 -2
- package/src/core/tasks/helpers/estimateTransactionRequest.ts +4 -2
- package/src/core/tasks/helpers/getEthereumExecutionStrategy.ts +12 -3
- package/src/core/tasks/helpers/getUpdatedStep.ts +26 -25
- package/src/core/tasks/helpers/shouldCheckForAllowance.ts +8 -0
- package/src/errors/parseEthereumErrors.ts +11 -2
- package/src/index.ts +0 -1
- package/src/permits/allowanceTransfer.ts +1 -1
- package/src/permits/getNativePermit.ts +9 -5
- package/src/permits/getPermitTransferFromValues.ts +2 -1
- package/src/permits/isNativePermitValid.ts +1 -1
- package/src/types.ts +7 -2
- package/src/utils/getActionWithFallback.ts +3 -2
- package/src/utils/getSendChain.ts +6 -0
- package/src/utils/isGaslessStep.ts +7 -0
- package/src/version.ts +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseStepExecutionTask,
|
|
3
3
|
ExecuteStepRetryError,
|
|
4
|
+
isGaslessStep,
|
|
4
5
|
LiFiErrorCode,
|
|
5
6
|
stepComparison,
|
|
6
7
|
type TaskResult,
|
|
@@ -13,7 +14,10 @@ import {
|
|
|
13
14
|
getEthereumExecutionStrategy,
|
|
14
15
|
STRATEGY_AFTER_PREPARE,
|
|
15
16
|
} from './helpers/getEthereumExecutionStrategy.js'
|
|
16
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
type GaslessStepFields,
|
|
19
|
+
getUpdatedStep,
|
|
20
|
+
} from './helpers/getUpdatedStep.js'
|
|
17
21
|
import { isAllowancePreparedForAnotherStrategy } from './helpers/isAllowancePreparedForAnotherStrategy.js'
|
|
18
22
|
import { preservePermit2Allowances } from './helpers/preservePermit2Allowances.js'
|
|
19
23
|
|
|
@@ -30,6 +34,7 @@ export class EthereumPrepareTransactionTask extends BaseStepExecutionTask {
|
|
|
30
34
|
signedTypedData,
|
|
31
35
|
ethereumClient,
|
|
32
36
|
fromChain,
|
|
37
|
+
disableMessageSigning,
|
|
33
38
|
} = context
|
|
34
39
|
|
|
35
40
|
const action = statusManager.findAction(
|
|
@@ -44,6 +49,15 @@ export class EthereumPrepareTransactionTask extends BaseStepExecutionTask {
|
|
|
44
49
|
)
|
|
45
50
|
}
|
|
46
51
|
|
|
52
|
+
// The relayer executes a gasless step from the user's signature, and the
|
|
53
|
+
// user has no gas to send it themselves. Fail before the re-quote.
|
|
54
|
+
if (isGaslessStep(step) && disableMessageSigning) {
|
|
55
|
+
throw new TransactionError(
|
|
56
|
+
LiFiErrorCode.TransactionUnprepared,
|
|
57
|
+
'Unable to prepare transaction. A gasless step needs message signing, which is disabled.'
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
47
61
|
// A replay restores it, so the replay re-quotes like this attempt did.
|
|
48
62
|
const typedDataBeforePrepare = step.typedData
|
|
49
63
|
|
|
@@ -51,11 +65,22 @@ export class EthereumPrepareTransactionTask extends BaseStepExecutionTask {
|
|
|
51
65
|
const updatedStep = await getUpdatedStep(
|
|
52
66
|
client,
|
|
53
67
|
step,
|
|
54
|
-
fromChain,
|
|
55
68
|
executionOptions,
|
|
56
69
|
signedTypedData
|
|
57
70
|
)
|
|
58
71
|
|
|
72
|
+
// An EIP-7702 authorization installs a delegation on an account that has
|
|
73
|
+
// none. The relayer rejects it for now, so signing it would be wasted.
|
|
74
|
+
if (
|
|
75
|
+
isGaslessStep(step) &&
|
|
76
|
+
(updatedStep as GaslessStepFields).authorization
|
|
77
|
+
) {
|
|
78
|
+
throw new TransactionError(
|
|
79
|
+
LiFiErrorCode.TransactionUnprepared,
|
|
80
|
+
'Unable to prepare transaction. The gasless step needs an EIP-7702 authorization, which the relayer does not support yet.'
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
|
|
59
84
|
const comparedStep = await stepComparison(
|
|
60
85
|
statusManager,
|
|
61
86
|
step,
|
|
@@ -132,7 +157,8 @@ export class EthereumPrepareTransactionTask extends BaseStepExecutionTask {
|
|
|
132
157
|
}
|
|
133
158
|
maxPriorityFeePerGas = await getMaxPriorityFeePerGas(
|
|
134
159
|
client,
|
|
135
|
-
updatedClient
|
|
160
|
+
updatedClient,
|
|
161
|
+
fromChain.id
|
|
136
162
|
)
|
|
137
163
|
} else {
|
|
138
164
|
maxPriorityFeePerGas = step.transactionRequest.maxPriorityFeePerGas
|
|
@@ -4,6 +4,7 @@ import { resolveTransactionHash } from '../../actions/resolveTransactionHash.js'
|
|
|
4
4
|
import { setAllowance } from '../../actions/setAllowance.js'
|
|
5
5
|
import { waitForTransactionReceipt } from '../../actions/waitForTransactionReceipt.js'
|
|
6
6
|
import type { EthereumStepExecutorContext } from '../../types.js'
|
|
7
|
+
import { convertExtendedChain } from '../../utils/convertExtendedChain.js'
|
|
7
8
|
import { getEthereumExecutionStrategy } from './helpers/getEthereumExecutionStrategy.js'
|
|
8
9
|
import { getTxLink } from './helpers/getTxLink.js'
|
|
9
10
|
import { resolveAllowanceSpender } from './helpers/resolveAllowanceSpender.js'
|
|
@@ -71,7 +72,8 @@ export class EthereumResetAllowanceTask extends BaseStepExecutionTask {
|
|
|
71
72
|
spenderAddress,
|
|
72
73
|
0n,
|
|
73
74
|
executionOptions,
|
|
74
|
-
batchingSupported
|
|
75
|
+
batchingSupported,
|
|
76
|
+
convertExtendedChain(fromChain)
|
|
75
77
|
)
|
|
76
78
|
|
|
77
79
|
const calls = [...currentCalls]
|
|
@@ -96,7 +98,7 @@ export class EthereumResetAllowanceTask extends BaseStepExecutionTask {
|
|
|
96
98
|
const transactionReceipt = await waitForTransactionReceipt(client, {
|
|
97
99
|
client: updatedClient,
|
|
98
100
|
chainId: fromChain.id,
|
|
99
|
-
txHash:
|
|
101
|
+
txHash: resolvedTxHash,
|
|
100
102
|
onReplaced(response) {
|
|
101
103
|
const newHash = response.transaction.hash
|
|
102
104
|
statusManager.updateAction(step, action.type, 'PENDING', {
|
|
@@ -4,6 +4,7 @@ import { resolveTransactionHash } from '../../actions/resolveTransactionHash.js'
|
|
|
4
4
|
import { setAllowance } from '../../actions/setAllowance.js'
|
|
5
5
|
import { waitForTransactionReceipt } from '../../actions/waitForTransactionReceipt.js'
|
|
6
6
|
import type { EthereumStepExecutorContext } from '../../types.js'
|
|
7
|
+
import { convertExtendedChain } from '../../utils/convertExtendedChain.js'
|
|
7
8
|
import { getApprovalAmount } from './helpers/getApprovalAmount.js'
|
|
8
9
|
import { getEthereumExecutionStrategy } from './helpers/getEthereumExecutionStrategy.js'
|
|
9
10
|
import { getTxLink } from './helpers/getTxLink.js'
|
|
@@ -70,7 +71,8 @@ export class EthereumSetAllowanceTask extends BaseStepExecutionTask {
|
|
|
70
71
|
executionOptions,
|
|
71
72
|
// We need to return the populated transaction when batching is supported
|
|
72
73
|
// instead of executing transaction on-chain
|
|
73
|
-
batchingSupported
|
|
74
|
+
batchingSupported,
|
|
75
|
+
convertExtendedChain(fromChain)
|
|
74
76
|
)
|
|
75
77
|
|
|
76
78
|
const calls = [...currentCalls]
|
|
@@ -97,7 +99,7 @@ export class EthereumSetAllowanceTask extends BaseStepExecutionTask {
|
|
|
97
99
|
const transactionReceipt = await waitForTransactionReceipt(client, {
|
|
98
100
|
client: updatedClient,
|
|
99
101
|
chainId: fromChain.id,
|
|
100
|
-
txHash:
|
|
102
|
+
txHash: resolvedTxHash,
|
|
101
103
|
onReplaced(response) {
|
|
102
104
|
const newHash = response.transaction.hash
|
|
103
105
|
statusManager.updateAction(step, action.type, 'PENDING', {
|
|
@@ -15,6 +15,7 @@ import { encodePermit2Data } from '../../permits/encodePermit2Data.js'
|
|
|
15
15
|
import { signPermit2Message } from '../../permits/signPermit2Message.js'
|
|
16
16
|
import type { EthereumStepExecutorContext } from '../../types.js'
|
|
17
17
|
import { convertExtendedChain } from '../../utils/convertExtendedChain.js'
|
|
18
|
+
import { getSendChain } from '../../utils/getSendChain.js'
|
|
18
19
|
import { estimateTransactionRequest } from './helpers/estimateTransactionRequest.js'
|
|
19
20
|
import { findSignedNativePermit } from './helpers/findSignedNativePermit.js'
|
|
20
21
|
import { getTxLink } from './helpers/getTxLink.js'
|
|
@@ -109,7 +110,8 @@ export class EthereumStandardSignAndExecuteTask extends BaseStepExecutionTask {
|
|
|
109
110
|
finalTransactionRequest = await estimateTransactionRequest(
|
|
110
111
|
client,
|
|
111
112
|
updatedClient,
|
|
112
|
-
finalTransactionRequest
|
|
113
|
+
finalTransactionRequest,
|
|
114
|
+
fromChain.id
|
|
113
115
|
)
|
|
114
116
|
}
|
|
115
117
|
|
|
@@ -131,7 +133,7 @@ export class EthereumStandardSignAndExecuteTask extends BaseStepExecutionTask {
|
|
|
131
133
|
gasPrice: finalTransactionRequest.gasPrice,
|
|
132
134
|
maxFeePerGas: finalTransactionRequest.maxFeePerGas,
|
|
133
135
|
maxPriorityFeePerGas: finalTransactionRequest.maxPriorityFeePerGas,
|
|
134
|
-
chain: convertExtendedChain(fromChain),
|
|
136
|
+
chain: getSendChain(updatedClient, convertExtendedChain(fromChain)),
|
|
135
137
|
} as SendTransactionParameters)
|
|
136
138
|
|
|
137
139
|
const resolvedTxHash = await resolveTransactionHash(
|
|
@@ -8,7 +8,8 @@ const GAS_ESTIMATION_BUFFER = 300_000n
|
|
|
8
8
|
export const estimateTransactionRequest = async (
|
|
9
9
|
client: SDKClient,
|
|
10
10
|
viemClient: Client,
|
|
11
|
-
transactionRequest: TransactionParameters
|
|
11
|
+
transactionRequest: TransactionParameters,
|
|
12
|
+
chainId: number | undefined
|
|
12
13
|
): Promise<TransactionParameters> => {
|
|
13
14
|
try {
|
|
14
15
|
// Try to re-estimate the gas due to additional Permit data
|
|
@@ -22,7 +23,8 @@ export const estimateTransactionRequest = async (
|
|
|
22
23
|
to: transactionRequest.to as Address,
|
|
23
24
|
data: transactionRequest.data as Hex,
|
|
24
25
|
value: transactionRequest.value,
|
|
25
|
-
}
|
|
26
|
+
},
|
|
27
|
+
chainId
|
|
26
28
|
)
|
|
27
29
|
// Use the higher of estimated vs original, then add buffer
|
|
28
30
|
const baseGas =
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { isGaslessStep, type TransactionMethodType } from '@lifi/sdk'
|
|
2
2
|
import { isBatchingSupported } from '../../../actions/isBatchingSupported.js'
|
|
3
3
|
import type { EthereumStepExecutorContext } from '../../../types.js'
|
|
4
4
|
import { isPermit2AllowanceLane } from '../../../utils/getTypedDataLane.js'
|
|
@@ -60,7 +60,14 @@ export async function getEthereumExecutionStrategy(
|
|
|
60
60
|
return strategyAfterPrepare
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
// A gasless step only executes through the relay. Before prepare it has no
|
|
64
|
+
// typed data yet, so the relay fee is the only signal.
|
|
65
|
+
if (isGaslessStep(step)) {
|
|
66
|
+
return 'relayed'
|
|
67
|
+
}
|
|
68
|
+
|
|
63
69
|
const atomicityNotReady = !!retryParams?.atomicityNotReady
|
|
70
|
+
|
|
64
71
|
// Declared by the backend. It is the only signal that reaches the allowance
|
|
65
72
|
// tasks, which run before a `transactionRequest` can exist.
|
|
66
73
|
if (step.executionType === 'message') {
|
|
@@ -91,9 +98,11 @@ export async function getEthereumExecutionStrategy(
|
|
|
91
98
|
}
|
|
92
99
|
|
|
93
100
|
const updatedClient = (await checkClient(step)) ?? ethereumClient
|
|
94
|
-
|
|
101
|
+
// A re-quote changes the step, not the wallet: prepare reuses the answer the
|
|
102
|
+
// allowance tasks acted on, so a late read cannot flip the strategy.
|
|
103
|
+
context.batchingSupported ??= isBatchingSupported(client, {
|
|
95
104
|
client: updatedClient,
|
|
96
105
|
chainId: fromChain.id,
|
|
97
106
|
})
|
|
98
|
-
return batchingSupported ? 'batched' : 'standard'
|
|
107
|
+
return (await context.batchingSupported) ? 'batched' : 'standard'
|
|
99
108
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
convertQuoteToRoute,
|
|
3
3
|
type ExecutionOptions,
|
|
4
|
-
type ExtendedChain,
|
|
5
4
|
getContractCallsQuote,
|
|
6
|
-
getRelayerQuote,
|
|
7
5
|
getStepTransaction,
|
|
6
|
+
isGaslessStep,
|
|
8
7
|
LiFiErrorCode,
|
|
9
8
|
type LiFiStepExtended,
|
|
10
9
|
patchContractCalls,
|
|
@@ -14,24 +13,19 @@ import {
|
|
|
14
13
|
} from '@lifi/sdk'
|
|
15
14
|
import { PatcherMagicNumber } from '../../../permits/constants.js'
|
|
16
15
|
import { isContractCallStep } from '../../../utils/isContractCallStep.js'
|
|
17
|
-
import { isGaslessStep } from '../../../utils/isGaslessStep.js'
|
|
18
16
|
|
|
19
17
|
/** Re-quotes the step through the endpoint that matches how it will execute. */
|
|
20
18
|
export const getUpdatedStep = async (
|
|
21
19
|
client: SDKClient,
|
|
22
20
|
step: LiFiStepExtended,
|
|
23
|
-
fromChain: ExtendedChain,
|
|
24
21
|
executionOptions?: ExecutionOptions,
|
|
25
22
|
signedTypedData?: SignedTypedData[]
|
|
26
23
|
): Promise<LiFiStepExtended> => {
|
|
27
24
|
if (isContractCallStep(step)) {
|
|
28
25
|
return getContractCallUpdatedStep(client, step, executionOptions)
|
|
29
26
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
// by `re-quotes an Order step ...` in `getUpdatedStep.unit.spec.ts`.
|
|
33
|
-
if (isGaslessStep(step, fromChain)) {
|
|
34
|
-
return getRelayerUpdatedStep(client, step)
|
|
27
|
+
if (isGaslessStep(step)) {
|
|
28
|
+
return getGaslessUpdatedStep(client, step)
|
|
35
29
|
}
|
|
36
30
|
return getStandardUpdatedStep(client, step, signedTypedData)
|
|
37
31
|
}
|
|
@@ -128,25 +122,32 @@ const getContractCallUpdatedStep = async (
|
|
|
128
122
|
}
|
|
129
123
|
}
|
|
130
124
|
|
|
131
|
-
|
|
125
|
+
/**
|
|
126
|
+
* Fields `/advanced/stepTransaction` adds to a gasless step. They are not in
|
|
127
|
+
* `@lifi/types` yet.
|
|
128
|
+
*/
|
|
129
|
+
export type GaslessStepFields = {
|
|
130
|
+
expiresAt?: number
|
|
131
|
+
authorization?: unknown
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* A gasless step is re-quoted as the routes response gave it: the backend
|
|
136
|
+
* rejects typed data without signatures, and it builds new typed data, a new
|
|
137
|
+
* deadline and new nonces for every quote anyway.
|
|
138
|
+
*/
|
|
139
|
+
const getGaslessUpdatedStep = async (
|
|
132
140
|
client: SDKClient,
|
|
133
141
|
step: LiFiStepExtended
|
|
134
142
|
): Promise<LiFiStepExtended> => {
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
toAddress: step.action.toAddress,
|
|
144
|
-
allowBridges: [step.tool],
|
|
145
|
-
})
|
|
146
|
-
return {
|
|
147
|
-
...updatedRelayedStep,
|
|
148
|
-
id: step.id,
|
|
149
|
-
}
|
|
143
|
+
const {
|
|
144
|
+
typedData: _typedData,
|
|
145
|
+
expiresAt: _expiresAt,
|
|
146
|
+
authorization: _authorization,
|
|
147
|
+
execution: _execution,
|
|
148
|
+
...restStep
|
|
149
|
+
} = step as LiFiStepExtended & GaslessStepFields
|
|
150
|
+
return getStepTransaction(client, restStep)
|
|
150
151
|
}
|
|
151
152
|
|
|
152
153
|
const getStandardUpdatedStep = async (
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
hasOpenTransaction,
|
|
3
|
+
isGaslessStep,
|
|
3
4
|
type LiFiStepExtended,
|
|
4
5
|
type StatusManager,
|
|
5
6
|
} from '@lifi/sdk'
|
|
@@ -10,6 +11,13 @@ export const shouldCheckForAllowance = (
|
|
|
10
11
|
isFromNativeToken: boolean,
|
|
11
12
|
statusManager: StatusManager
|
|
12
13
|
): boolean => {
|
|
14
|
+
// The relayer handles the allowance of a gasless step: the backend signs it
|
|
15
|
+
// in as a `Permit` companion or uses the Permit2 allowance the account has.
|
|
16
|
+
// An approve or an SDK permit here would cost the user gas they do not have.
|
|
17
|
+
if (isGaslessStep(step)) {
|
|
18
|
+
return false
|
|
19
|
+
}
|
|
20
|
+
|
|
13
21
|
const exchangeActionType = isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'
|
|
14
22
|
|
|
15
23
|
const swapOrBridgeAction = statusManager.findAction(step, exchangeActionType)
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
fetchTxErrorDetails,
|
|
8
8
|
LiFiErrorCode,
|
|
9
9
|
type LiFiStep,
|
|
10
|
+
ProviderError,
|
|
10
11
|
SDKError,
|
|
11
12
|
TransactionError,
|
|
12
13
|
UnknownError,
|
|
@@ -49,10 +50,13 @@ const handleSpecificErrors = async (
|
|
|
49
50
|
e: any,
|
|
50
51
|
step?: LiFiStep,
|
|
51
52
|
action?: ExecutionAction
|
|
52
|
-
) => {
|
|
53
|
+
): Promise<BaseError> => {
|
|
53
54
|
if (
|
|
54
55
|
e.name === 'UserRejectedRequestError' ||
|
|
55
|
-
e.cause?.name === 'UserRejectedRequestError'
|
|
56
|
+
e.cause?.name === 'UserRejectedRequestError' ||
|
|
57
|
+
// A raw EIP-1193 rejection, for example from a hook that calls the provider directly.
|
|
58
|
+
e.code === 4001 ||
|
|
59
|
+
e.cause?.code === 4001
|
|
56
60
|
) {
|
|
57
61
|
return new TransactionError(LiFiErrorCode.SignatureRejected, e.message, e)
|
|
58
62
|
}
|
|
@@ -91,6 +95,11 @@ const handleSpecificErrors = async (
|
|
|
91
95
|
if (e.cause?.code === -32603) {
|
|
92
96
|
return new TransactionError(LiFiErrorCode.TransactionRejected, e.message, e)
|
|
93
97
|
}
|
|
98
|
+
// wagmi connectors throw it for a failed switch that is not a rejection,
|
|
99
|
+
// for example for a chain that the wallet does not support.
|
|
100
|
+
if (e.name === 'SwitchChainError') {
|
|
101
|
+
return new ProviderError(LiFiErrorCode.ChainSwitchError, e.message, e)
|
|
102
|
+
}
|
|
94
103
|
|
|
95
104
|
/**
|
|
96
105
|
* This error is specific to Smart Accounts and thrown when the user doesn't have enough gas to pay for the transaction.
|
package/src/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
type TypedData,
|
|
5
5
|
type TypedDataDomain,
|
|
6
6
|
} from 'viem'
|
|
7
|
-
import { MaxSigDeadline,
|
|
7
|
+
import { MaxSigDeadline, MaxUint160, MaxUint48 } from './constants.js'
|
|
8
8
|
import { permit2Domain } from './domain.js'
|
|
9
9
|
import { invariant } from './invariant.js'
|
|
10
10
|
|
|
@@ -16,9 +16,9 @@ import { getActionWithFallback } from '../utils/getActionWithFallback.js'
|
|
|
16
16
|
import { canAccountUseNativePermits } from './canAccountUseNativePermits.js'
|
|
17
17
|
import {
|
|
18
18
|
DAI_LIKE_PERMIT_TYPEHASH,
|
|
19
|
+
eip2612Types,
|
|
19
20
|
EIP712_DOMAIN_TYPEHASH,
|
|
20
21
|
EIP712_DOMAIN_TYPEHASH_WITH_SALT,
|
|
21
|
-
eip2612Types,
|
|
22
22
|
} from './constants.js'
|
|
23
23
|
import type { NativePermitData } from './types.js'
|
|
24
24
|
|
|
@@ -175,7 +175,8 @@ const getEIP712DomainData = async (
|
|
|
175
175
|
{
|
|
176
176
|
contracts: contractCalls,
|
|
177
177
|
multicallAddress,
|
|
178
|
-
}
|
|
178
|
+
},
|
|
179
|
+
chainId
|
|
179
180
|
)
|
|
180
181
|
|
|
181
182
|
if (
|
|
@@ -243,7 +244,8 @@ const getEIP712DomainData = async (
|
|
|
243
244
|
viemClient,
|
|
244
245
|
readContract,
|
|
245
246
|
'readContract',
|
|
246
|
-
call
|
|
247
|
+
call,
|
|
248
|
+
chainId
|
|
247
249
|
)
|
|
248
250
|
)
|
|
249
251
|
)) as [
|
|
@@ -367,7 +369,8 @@ const getContractData = async (
|
|
|
367
369
|
{
|
|
368
370
|
contracts: contractCalls,
|
|
369
371
|
multicallAddress,
|
|
370
|
-
}
|
|
372
|
+
},
|
|
373
|
+
chainId
|
|
371
374
|
)
|
|
372
375
|
|
|
373
376
|
if (
|
|
@@ -420,7 +423,8 @@ const getContractData = async (
|
|
|
420
423
|
viemClient,
|
|
421
424
|
readContract,
|
|
422
425
|
'readContract',
|
|
423
|
-
call
|
|
426
|
+
call,
|
|
427
|
+
chainId
|
|
424
428
|
)
|
|
425
429
|
)
|
|
426
430
|
)) as [
|
|
@@ -51,7 +51,7 @@ export const isNativePermitValid = (
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
// Check deadline (must have at least 5 minutes remaining)
|
|
54
|
-
const deadlineTimestamp = parseInt(message.deadline || 0, 10)
|
|
54
|
+
const deadlineTimestamp = Number.parseInt(message.deadline || 0, 10)
|
|
55
55
|
// Add 5 minutes bufferto the current timestamp
|
|
56
56
|
const allowedTimestamp = Math.floor(Date.now() / 1000) + 5 * 60
|
|
57
57
|
|
package/src/types.ts
CHANGED
|
@@ -51,11 +51,16 @@ export interface EthereumTaskContext {
|
|
|
51
51
|
* indistinguishable from "not looked up yet" under a truthiness check.
|
|
52
52
|
*/
|
|
53
53
|
permit2SignerSupported?: Promise<boolean>
|
|
54
|
+
/**
|
|
55
|
+
* Whether the wallet batches calls (EIP-5792) on the source chain, memoized
|
|
56
|
+
* per execution by `getEthereumExecutionStrategy`. A promise for the same
|
|
57
|
+
* reason as {@link permit2SignerSupported}.
|
|
58
|
+
*/
|
|
59
|
+
batchingSupported?: Promise<boolean>
|
|
54
60
|
}
|
|
55
61
|
|
|
56
62
|
export interface EthereumStepExecutorContext
|
|
57
|
-
extends StepExecutorContext,
|
|
58
|
-
EthereumTaskContext {
|
|
63
|
+
extends StepExecutorContext, EthereumTaskContext {
|
|
59
64
|
isFromNativeToken: boolean
|
|
60
65
|
ethereumClient: Client
|
|
61
66
|
checkClient: (
|
|
@@ -23,6 +23,7 @@ import { getPublicClient } from '../client/publicClient.js'
|
|
|
23
23
|
* @param action - The function or method to execute
|
|
24
24
|
* @param actionName - The name of the action (used for error handling)
|
|
25
25
|
* @param params - The parameters for the action
|
|
26
|
+
* @param chainId - The chain of the fallback public client. Pass the step chain: `walletClient.chain` can be stale.
|
|
26
27
|
* @returns The result of the action
|
|
27
28
|
*/
|
|
28
29
|
export const getActionWithFallback = async <
|
|
@@ -39,7 +40,8 @@ export const getActionWithFallback = async <
|
|
|
39
40
|
walletClient: client,
|
|
40
41
|
actionFn: (_: client, parameters: parameters) => returnType,
|
|
41
42
|
name: keyof PublicActions | keyof WalletActions | (string & {}),
|
|
42
|
-
params: parameters
|
|
43
|
+
params: parameters,
|
|
44
|
+
chainId: number | undefined
|
|
43
45
|
): Promise<Awaited<returnType>> => {
|
|
44
46
|
try {
|
|
45
47
|
return await getAction(walletClient, actionFn, name)(params)
|
|
@@ -50,7 +52,6 @@ export const getActionWithFallback = async <
|
|
|
50
52
|
throw error
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
const chainId = walletClient.chain?.id
|
|
54
55
|
if (!chainId) {
|
|
55
56
|
throw error
|
|
56
57
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Chain, Client } from 'viem'
|
|
2
|
+
|
|
3
|
+
// A matching `client.chain` keeps its fees, serializers and custom fields; a
|
|
4
|
+
// stale or missing one gives way to the given chain.
|
|
5
|
+
export const getSendChain = (client: Client, chain: Chain): Chain =>
|
|
6
|
+
client.chain?.id === chain.id ? client.chain : chain
|
|
@@ -20,6 +20,13 @@ export function isGaslessTypedData(
|
|
|
20
20
|
)
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Whether the step carries typed data of the legacy gasless relayer.
|
|
25
|
+
*
|
|
26
|
+
* @deprecated The legacy gasless relayer service is shut down, and a step of
|
|
27
|
+
* the new gasless flow has no typed data at routes time. Use `isGaslessStep`
|
|
28
|
+
* from `@lifi/sdk`, which detects the relay fee.
|
|
29
|
+
*/
|
|
23
30
|
export function isGaslessStep(
|
|
24
31
|
step: LiFiStepExtended | LiFiStep,
|
|
25
32
|
chain?: ExtendedChain
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/sdk-provider-ethereum'
|
|
2
|
-
export const version = '4.
|
|
2
|
+
export const version = '4.3.1'
|