@lifi/sdk-provider-ethereum 4.2.12 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -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
|
@@ -2,11 +2,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_actions_resolveENSAddress = require("./resolveENSAddress.js");
|
|
3
3
|
const require_actions_resolveUNSAddress = require("./resolveUNSAddress.js");
|
|
4
4
|
let _lifi_sdk = require("@lifi/sdk");
|
|
5
|
-
|
|
5
|
+
// src/actions/resolveEthereumAddress.ts
|
|
6
6
|
async function resolveEthereumAddress(name, client, chainId, token) {
|
|
7
7
|
return await require_actions_resolveENSAddress.resolveENSAddress(client, name) || await require_actions_resolveUNSAddress.resolveUNSAddress(client, name, _lifi_sdk.ChainType.EVM, chainId, token);
|
|
8
8
|
}
|
|
9
|
-
//#endregion
|
|
10
9
|
exports.resolveEthereumAddress = resolveEthereumAddress;
|
|
11
10
|
|
|
12
11
|
//# sourceMappingURL=resolveEthereumAddress.js.map
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import { SDKClient } from "@lifi/sdk";
|
|
2
2
|
import { Client, Hash } from "viem";
|
|
3
|
-
|
|
4
|
-
export declare const resolveTransactionHash: (client: SDKClient, viemClient: Client, txHashOrSignature: Hash, chainId: number) => Promise<Hash>;
|
|
5
|
-
//#endregion
|
|
6
|
-
//# sourceMappingURL=resolveTransactionHash.d.ts.map
|
|
3
|
+
export declare const resolveTransactionHash: (client: SDKClient, viemClient: Client, txHashOrSignature: Hash, chainId: number) => Promise<Hash>;
|
|
@@ -2,15 +2,19 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_actions_isSafeSignature = require("./isSafeSignature.js");
|
|
3
3
|
const require_actions_waitForSafeTransactionExecution = require("./waitForSafeTransactionExecution.js");
|
|
4
4
|
let _lifi_sdk = require("@lifi/sdk");
|
|
5
|
-
|
|
5
|
+
let viem = require("viem");
|
|
6
|
+
// src/actions/resolveTransactionHash.ts
|
|
6
7
|
const resolveTransactionHash = async (client, viemClient, txHashOrSignature, chainId) => {
|
|
7
8
|
if (!await require_actions_isSafeSignature.isSafeSignature(client, {
|
|
8
9
|
hash: txHashOrSignature,
|
|
9
10
|
chainId,
|
|
10
11
|
address: viemClient.account?.address
|
|
11
|
-
}))
|
|
12
|
+
})) {
|
|
13
|
+
if (!(0, viem.isHex)(txHashOrSignature) || txHashOrSignature.length < 66) throw new _lifi_sdk.TransactionError(_lifi_sdk.LiFiErrorCode.TransactionFailed, "The wallet did not return a transaction hash. The wallet may have sent the transaction. Before you try again, check the activity in your wallet.");
|
|
14
|
+
return txHashOrSignature;
|
|
15
|
+
}
|
|
12
16
|
const safeAddress = viemClient.account?.address;
|
|
13
|
-
if (!safeAddress
|
|
17
|
+
if (!safeAddress) throw new _lifi_sdk.TransactionError(_lifi_sdk.LiFiErrorCode.TransactionFailed, "Safe address not available for transaction tracking.");
|
|
14
18
|
return await require_actions_waitForSafeTransactionExecution.waitForSafeTransactionExecution(client, {
|
|
15
19
|
chainId,
|
|
16
20
|
safeAddress,
|
|
@@ -18,7 +22,6 @@ const resolveTransactionHash = async (client, viemClient, txHashOrSignature, cha
|
|
|
18
22
|
pollingInterval: 5e3
|
|
19
23
|
});
|
|
20
24
|
};
|
|
21
|
-
//#endregion
|
|
22
25
|
exports.resolveTransactionHash = resolveTransactionHash;
|
|
23
26
|
|
|
24
27
|
//# sourceMappingURL=resolveTransactionHash.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveTransactionHash.js","names":["isSafeSignature","TransactionError","LiFiErrorCode","waitForSafeTransactionExecution"],"sources":["../../../src/actions/resolveTransactionHash.ts"],"sourcesContent":["import { LiFiErrorCode, type SDKClient, TransactionError } from '@lifi/sdk'\nimport type
|
|
1
|
+
{"version":3,"file":"resolveTransactionHash.js","names":["isSafeSignature","isHex","TransactionError","LiFiErrorCode","waitForSafeTransactionExecution"],"sources":["../../../src/actions/resolveTransactionHash.ts"],"sourcesContent":["import { LiFiErrorCode, type SDKClient, TransactionError } from '@lifi/sdk'\nimport { type Client, type Hash, isHex } from 'viem'\nimport { isSafeSignature } from './isSafeSignature.js'\nimport { waitForSafeTransactionExecution } from './waitForSafeTransactionExecution.js'\n\nexport const resolveTransactionHash = async (\n client: SDKClient,\n viemClient: Client,\n txHashOrSignature: Hash,\n chainId: number\n): Promise<Hash> => {\n const isSignature = await isSafeSignature(client, {\n hash: txHashOrSignature,\n chainId,\n address: viemClient.account?.address,\n })\n\n if (!isSignature) {\n // Unchecked wallet answer; longer hex can be a Safe signature the lookup missed.\n if (!isHex(txHashOrSignature) || txHashOrSignature.length < 66) {\n throw new TransactionError(\n LiFiErrorCode.TransactionFailed,\n 'The wallet did not return a transaction hash. The wallet may have sent the transaction. Before you try again, check the activity in your wallet.'\n )\n }\n return txHashOrSignature\n }\n\n const safeAddress = viemClient.account?.address\n if (!safeAddress) {\n throw new TransactionError(\n LiFiErrorCode.TransactionFailed,\n 'Safe address not available for transaction tracking.'\n )\n }\n\n return await waitForSafeTransactionExecution(client, {\n chainId,\n safeAddress,\n signature: txHashOrSignature,\n pollingInterval: 5_000,\n })\n}\n"],"mappings":";;;;;;AAKA,MAAa,yBAAyB,OACpC,QACA,YACA,mBACA,YACkB;CAOlB,IAAI,CAAC,MANqBA,gCAAAA,gBAAgB,QAAQ;EAChD,MAAM;EACN;EACA,SAAS,WAAW,SAAS;CAC/B,CAAC,GAEiB;EAEhB,IAAI,EAAA,GAACC,KAAAA,MAAAA,CAAM,iBAAiB,KAAK,kBAAkB,SAAS,IAC1D,MAAM,IAAIC,UAAAA,iBACRC,UAAAA,cAAc,mBACd,kJACF;EAEF,OAAO;CACT;CAEA,MAAM,cAAc,WAAW,SAAS;CACxC,IAAI,CAAC,aACH,MAAM,IAAID,UAAAA,iBACRC,UAAAA,cAAc,mBACd,sDACF;CAGF,OAAO,MAAMC,gDAAAA,gCAAgC,QAAQ;EACnD;EACA;EACA,WAAW;EACX,iBAAiB;CACnB,CAAC;AACH"}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
import { ChainId, ChainType, CoinKey, SDKClient } from "@lifi/sdk";
|
|
2
|
-
|
|
3
|
-
export declare const resolveUNSAddress: (client: SDKClient, name: string, chainType: ChainType, chain?: ChainId, token?: CoinKey) => Promise<string | undefined>;
|
|
4
|
-
//#endregion
|
|
5
|
-
//# sourceMappingURL=resolveUNSAddress.d.ts.map
|
|
2
|
+
export declare const resolveUNSAddress: (client: SDKClient, name: string, chainType: ChainType, chain?: ChainId, token?: CoinKey) => Promise<string | undefined>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_actions_constants = require("./constants.js");
|
|
3
2
|
const require_client_publicClient = require("../client/publicClient.js");
|
|
3
|
+
const require_actions_constants = require("./constants.js");
|
|
4
4
|
let _lifi_sdk = require("@lifi/sdk");
|
|
5
5
|
let viem_actions = require("viem/actions");
|
|
6
6
|
let viem_ens = require("viem/ens");
|
|
7
7
|
let viem_utils = require("viem/utils");
|
|
8
|
-
|
|
8
|
+
// src/actions/resolveUNSAddress.ts
|
|
9
9
|
const resolveUNSAddress = async (client, name, chainType, chain, token) => {
|
|
10
10
|
try {
|
|
11
11
|
const L1Client = await require_client_publicClient.getPublicClient(client, _lifi_sdk.ChainId.ETH);
|
|
@@ -61,7 +61,6 @@ async function getUnsAddress(client, params) {
|
|
|
61
61
|
if (address === "0x" || address === "" || (0, viem_utils.trim)(address) === "0x00") return;
|
|
62
62
|
return address;
|
|
63
63
|
}
|
|
64
|
-
//#endregion
|
|
65
64
|
exports.resolveUNSAddress = resolveUNSAddress;
|
|
66
65
|
|
|
67
66
|
//# sourceMappingURL=resolveUNSAddress.js.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ApproveTokenRequest, RevokeApprovalRequest } from "../types.js";
|
|
2
2
|
import { ExecutionOptions, SDKClient } from "@lifi/sdk";
|
|
3
|
-
import { Address, Client, Hash, Hex } from "viem";
|
|
4
|
-
|
|
5
|
-
export declare const setAllowance: (client: SDKClient, viemClient: Client, tokenAddress: Address, contractAddress: Address, amount: bigint, executionOptions?: ExecutionOptions, returnPopulatedTransaction?: boolean) => Promise<Hash | Hex>;
|
|
3
|
+
import { Address, Chain, Client, Hash, Hex } from "viem";
|
|
4
|
+
export declare const setAllowance: (client: SDKClient, viemClient: Client, tokenAddress: Address, contractAddress: Address, amount: bigint, executionOptions?: ExecutionOptions, returnPopulatedTransaction?: boolean, chain?: Chain) => Promise<Hash | Hex>;
|
|
6
5
|
/**
|
|
7
6
|
* Set approval for a certain token and amount.
|
|
8
7
|
* @param client - The SDK client
|
|
@@ -23,6 +22,4 @@ export declare const setTokenAllowance: (client: SDKClient, { walletClient, toke
|
|
|
23
22
|
* @param request.spenderAddress - The address of the spender
|
|
24
23
|
* @returns Returns Hash or nothing
|
|
25
24
|
*/
|
|
26
|
-
export declare const revokeTokenApproval: (client: SDKClient, { walletClient, token, spenderAddress }: RevokeApprovalRequest) => Promise<Hash | void>;
|
|
27
|
-
//#endregion
|
|
28
|
-
//# sourceMappingURL=setAllowance.d.ts.map
|
|
25
|
+
export declare const revokeTokenApproval: (client: SDKClient, { walletClient, token, spenderAddress }: RevokeApprovalRequest) => Promise<Hash | void>;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_utils_abi = require("../utils/abi.js");
|
|
3
|
+
const require_utils_convertExtendedChain = require("../utils/convertExtendedChain.js");
|
|
4
|
+
const require_utils_getSendChain = require("../utils/getSendChain.js");
|
|
3
5
|
const require_utils_isZeroAddress = require("../utils/isZeroAddress.js");
|
|
4
6
|
const require_actions_getAllowance = require("./getAllowance.js");
|
|
5
7
|
const require_actions_getMaxPriorityFeePerGas = require("./getMaxPriorityFeePerGas.js");
|
|
6
8
|
let viem = require("viem");
|
|
7
9
|
let viem_actions = require("viem/actions");
|
|
8
10
|
let viem_utils = require("viem/utils");
|
|
9
|
-
|
|
10
|
-
const setAllowance = async (client, viemClient, tokenAddress, contractAddress, amount, executionOptions, returnPopulatedTransaction) => {
|
|
11
|
+
// src/actions/setAllowance.ts
|
|
12
|
+
const setAllowance = async (client, viemClient, tokenAddress, contractAddress, amount, executionOptions, returnPopulatedTransaction, chain) => {
|
|
11
13
|
const data = (0, viem.encodeFunctionData)({
|
|
12
14
|
abi: require_utils_abi.approveAbi,
|
|
13
15
|
functionName: "approve",
|
|
@@ -17,7 +19,7 @@ const setAllowance = async (client, viemClient, tokenAddress, contractAddress, a
|
|
|
17
19
|
let transactionRequest = {
|
|
18
20
|
to: tokenAddress,
|
|
19
21
|
data,
|
|
20
|
-
maxPriorityFeePerGas: viemClient.account?.type === "local" ? await require_actions_getMaxPriorityFeePerGas.getMaxPriorityFeePerGas(client, viemClient) : void 0
|
|
22
|
+
maxPriorityFeePerGas: viemClient.account?.type === "local" ? await require_actions_getMaxPriorityFeePerGas.getMaxPriorityFeePerGas(client, viemClient, chain?.id ?? viemClient.chain?.id) : void 0
|
|
21
23
|
};
|
|
22
24
|
if (executionOptions?.updateTransactionRequestHook) {
|
|
23
25
|
const customizedTransactionRequest = await executionOptions.updateTransactionRequestHook({
|
|
@@ -36,9 +38,11 @@ const setAllowance = async (client, viemClient, tokenAddress, contractAddress, a
|
|
|
36
38
|
gas: transactionRequest.gas,
|
|
37
39
|
gasPrice: transactionRequest.gasPrice,
|
|
38
40
|
maxFeePerGas: transactionRequest.maxFeePerGas,
|
|
39
|
-
maxPriorityFeePerGas: transactionRequest.maxPriorityFeePerGas
|
|
41
|
+
maxPriorityFeePerGas: transactionRequest.maxPriorityFeePerGas,
|
|
42
|
+
...chain && { chain: require_utils_getSendChain.getSendChain(viemClient, chain) }
|
|
40
43
|
});
|
|
41
44
|
};
|
|
45
|
+
const getTokenChain = (client, chainId) => client.getChainById(chainId).then(require_utils_convertExtendedChain.convertExtendedChain, () => void 0);
|
|
42
46
|
/**
|
|
43
47
|
* Set approval for a certain token and amount.
|
|
44
48
|
* @param client - The SDK client
|
|
@@ -51,7 +55,7 @@ const setAllowance = async (client, viemClient, tokenAddress, contractAddress, a
|
|
|
51
55
|
*/
|
|
52
56
|
const setTokenAllowance = async (client, { walletClient, token, spenderAddress, amount }) => {
|
|
53
57
|
if (require_utils_isZeroAddress.isZeroAddress(token.address)) return;
|
|
54
|
-
if (amount > await require_actions_getAllowance.getAllowance(client, walletClient, token.address, walletClient.account.address, spenderAddress)) return await setAllowance(client, walletClient, token.address, spenderAddress, amount);
|
|
58
|
+
if (amount > await require_actions_getAllowance.getAllowance(client, walletClient, token.address, walletClient.account.address, spenderAddress, token.chainId)) return await setAllowance(client, walletClient, token.address, spenderAddress, amount, void 0, false, await getTokenChain(client, token.chainId));
|
|
55
59
|
};
|
|
56
60
|
/**
|
|
57
61
|
* Revoke approval for a certain token.
|
|
@@ -64,9 +68,8 @@ const setTokenAllowance = async (client, { walletClient, token, spenderAddress,
|
|
|
64
68
|
*/
|
|
65
69
|
const revokeTokenApproval = async (client, { walletClient, token, spenderAddress }) => {
|
|
66
70
|
if (require_utils_isZeroAddress.isZeroAddress(token.address)) return;
|
|
67
|
-
if (await require_actions_getAllowance.getAllowance(client, walletClient, token.address, walletClient.account.address, spenderAddress) > 0) return await setAllowance(client, walletClient, token.address, spenderAddress, 0n);
|
|
71
|
+
if (await require_actions_getAllowance.getAllowance(client, walletClient, token.address, walletClient.account.address, spenderAddress, token.chainId) > 0) return await setAllowance(client, walletClient, token.address, spenderAddress, 0n, void 0, false, await getTokenChain(client, token.chainId));
|
|
68
72
|
};
|
|
69
|
-
//#endregion
|
|
70
73
|
exports.revokeTokenApproval = revokeTokenApproval;
|
|
71
74
|
exports.setAllowance = setAllowance;
|
|
72
75
|
exports.setTokenAllowance = setTokenAllowance;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setAllowance.js","names":["encodeFunctionData","approveAbi","getMaxPriorityFeePerGas","getAction","sendTransaction","isZeroAddress","getAllowance"],"sources":["../../../src/actions/setAllowance.ts"],"sourcesContent":["import type {\n ExecutionOptions,\n SDKClient,\n TransactionParameters,\n} from '@lifi/sdk'\nimport type {\n Address,\n Client,\n Hash,\n Hex,\n SendTransactionParameters,\n} from 'viem'\nimport { encodeFunctionData } from 'viem'\nimport { sendTransaction } from 'viem/actions'\nimport { getAction } from 'viem/utils'\nimport type { ApproveTokenRequest, RevokeApprovalRequest } from '../types.js'\nimport { approveAbi } from '../utils/abi.js'\nimport { isZeroAddress } from '../utils/isZeroAddress.js'\nimport { getAllowance } from './getAllowance.js'\nimport { getMaxPriorityFeePerGas } from './getMaxPriorityFeePerGas.js'\n\nexport const setAllowance = async (\n client: SDKClient,\n viemClient: Client,\n tokenAddress: Address,\n contractAddress: Address,\n amount: bigint,\n executionOptions?: ExecutionOptions,\n returnPopulatedTransaction?: boolean\n): Promise<Hash | Hex> => {\n const data = encodeFunctionData({\n abi: approveAbi,\n functionName: 'approve',\n args: [contractAddress, amount],\n })\n\n if (returnPopulatedTransaction) {\n return data\n }\n\n let transactionRequest: TransactionParameters = {\n to: tokenAddress,\n data,\n maxPriorityFeePerGas:\n viemClient.account?.type === 'local'\n ? await getMaxPriorityFeePerGas(client
|
|
1
|
+
{"version":3,"file":"setAllowance.js","names":["encodeFunctionData","approveAbi","getMaxPriorityFeePerGas","getAction","sendTransaction","getSendChain","convertExtendedChain","isZeroAddress","getAllowance"],"sources":["../../../src/actions/setAllowance.ts"],"sourcesContent":["import type {\n ExecutionOptions,\n SDKClient,\n TransactionParameters,\n} from '@lifi/sdk'\nimport type {\n Address,\n Chain,\n Client,\n Hash,\n Hex,\n SendTransactionParameters,\n} from 'viem'\nimport { encodeFunctionData } from 'viem'\nimport { sendTransaction } from 'viem/actions'\nimport { getAction } from 'viem/utils'\nimport type { ApproveTokenRequest, RevokeApprovalRequest } from '../types.js'\nimport { approveAbi } from '../utils/abi.js'\nimport { convertExtendedChain } from '../utils/convertExtendedChain.js'\nimport { getSendChain } from '../utils/getSendChain.js'\nimport { isZeroAddress } from '../utils/isZeroAddress.js'\nimport { getAllowance } from './getAllowance.js'\nimport { getMaxPriorityFeePerGas } from './getMaxPriorityFeePerGas.js'\n\nexport const setAllowance = async (\n client: SDKClient,\n viemClient: Client,\n tokenAddress: Address,\n contractAddress: Address,\n amount: bigint,\n executionOptions?: ExecutionOptions,\n returnPopulatedTransaction?: boolean,\n // Without it viem uses `viemClient.chain`, which can be stale.\n chain?: Chain\n): Promise<Hash | Hex> => {\n const data = encodeFunctionData({\n abi: approveAbi,\n functionName: 'approve',\n args: [contractAddress, amount],\n })\n\n if (returnPopulatedTransaction) {\n return data\n }\n\n let transactionRequest: TransactionParameters = {\n to: tokenAddress,\n data,\n maxPriorityFeePerGas:\n viemClient.account?.type === 'local'\n ? await getMaxPriorityFeePerGas(\n client,\n viemClient,\n chain?.id ?? viemClient.chain?.id\n )\n : undefined,\n }\n\n if (executionOptions?.updateTransactionRequestHook) {\n const customizedTransactionRequest: TransactionParameters =\n await executionOptions.updateTransactionRequestHook({\n requestType: 'approve',\n ...transactionRequest,\n })\n\n transactionRequest = {\n ...transactionRequest,\n ...customizedTransactionRequest,\n }\n }\n\n return getAction(\n viemClient,\n sendTransaction,\n 'sendTransaction'\n )({\n to: transactionRequest.to,\n account: viemClient.account!,\n data: transactionRequest.data,\n gas: transactionRequest.gas,\n gasPrice: transactionRequest.gasPrice,\n maxFeePerGas: transactionRequest.maxFeePerGas,\n maxPriorityFeePerGas: transactionRequest.maxPriorityFeePerGas,\n ...(chain && { chain: getSendChain(viemClient, chain) }),\n } as SendTransactionParameters)\n}\n\n// Without a known chain, viem keeps `walletClient.chain`, as before.\nconst getTokenChain = (\n client: SDKClient,\n chainId: number\n): Promise<Chain | undefined> =>\n client.getChainById(chainId).then(convertExtendedChain, () => undefined)\n\n/**\n * Set approval for a certain token and amount.\n * @param client - The SDK client\n * @param request - The approval request\n * @param request.walletClient - The Viem wallet client used to send the transaction\n * @param request.token - The token for which to set the allowance\n * @param request.spenderAddress - The address of the spender\n * @param request.amount - The amount of tokens to approve\n * @returns Returns Hash or nothing\n */\nexport const setTokenAllowance = async (\n client: SDKClient,\n { walletClient, token, spenderAddress, amount }: ApproveTokenRequest\n): Promise<Hash | void> => {\n // native token don't need approval\n if (isZeroAddress(token.address)) {\n return\n }\n const approvedAmount = await getAllowance(\n client,\n walletClient,\n token.address as Address,\n walletClient.account!.address,\n spenderAddress as Address,\n token.chainId\n )\n\n if (amount > approvedAmount) {\n const approveTx = await setAllowance(\n client,\n walletClient,\n token.address as Address,\n spenderAddress as Address,\n amount,\n undefined,\n false,\n await getTokenChain(client, token.chainId)\n )\n\n return approveTx\n }\n}\n\n/**\n * Revoke approval for a certain token.\n * @param client - The SDK client\n * @param request - The revoke request\n * @param request.walletClient - The Viem wallet client used to send the transaction\n * @param request.token - The token for which to revoke the allowance\n * @param request.spenderAddress - The address of the spender\n * @returns Returns Hash or nothing\n */\nexport const revokeTokenApproval = async (\n client: SDKClient,\n { walletClient, token, spenderAddress }: RevokeApprovalRequest\n): Promise<Hash | void> => {\n // native token don't need approval\n if (isZeroAddress(token.address)) {\n return\n }\n const approvedAmount = await getAllowance(\n client,\n walletClient,\n token.address as Address,\n walletClient.account!.address,\n spenderAddress as Address,\n token.chainId\n )\n if (approvedAmount > 0) {\n const approveTx = await setAllowance(\n client,\n walletClient,\n token.address as Address,\n spenderAddress as Address,\n 0n,\n undefined,\n false,\n await getTokenChain(client, token.chainId)\n )\n\n return approveTx\n }\n}\n"],"mappings":";;;;;;;;;;;AAwBA,MAAa,eAAe,OAC1B,QACA,YACA,cACA,iBACA,QACA,kBACA,4BAEA,UACwB;CACxB,MAAM,QAAA,GAAOA,KAAAA,mBAAAA,CAAmB;EAC9B,KAAKC,kBAAAA;EACL,cAAc;EACd,MAAM,CAAC,iBAAiB,MAAM;CAChC,CAAC;CAED,IAAI,4BACF,OAAO;CAGT,IAAI,qBAA4C;EAC9C,IAAI;EACJ;EACA,sBACE,WAAW,SAAS,SAAS,UACzB,MAAMC,wCAAAA,wBACJ,QACA,YACA,OAAO,MAAM,WAAW,OAAO,EACjC,IACA,KAAA;CACR;CAEA,IAAI,kBAAkB,8BAA8B;EAClD,MAAM,+BACJ,MAAM,iBAAiB,6BAA6B;GAClD,aAAa;GACb,GAAG;EACL,CAAC;EAEH,qBAAqB;GACnB,GAAG;GACH,GAAG;EACL;CACF;CAEA,QAAA,GAAOC,WAAAA,UAAAA,CACL,YACAC,aAAAA,iBACA,iBACF,CAAC,CAAC;EACA,IAAI,mBAAmB;EACvB,SAAS,WAAW;EACpB,MAAM,mBAAmB;EACzB,KAAK,mBAAmB;EACxB,UAAU,mBAAmB;EAC7B,cAAc,mBAAmB;EACjC,sBAAsB,mBAAmB;EACzC,GAAI,SAAS,EAAE,OAAOC,2BAAAA,aAAa,YAAY,KAAK,EAAE;CACxD,CAA8B;AAChC;AAGA,MAAM,iBACJ,QACA,YAEA,OAAO,aAAa,OAAO,CAAC,CAAC,KAAKC,mCAAAA,4BAA4B,KAAA,CAAS;;;;;;;;;;;AAYzE,MAAa,oBAAoB,OAC/B,QACA,EAAE,cAAc,OAAO,gBAAgB,aACd;CAEzB,IAAIC,4BAAAA,cAAc,MAAM,OAAO,GAC7B;CAWF,IAAI,SAAS,MATgBC,6BAAAA,aAC3B,QACA,cACA,MAAM,SACN,aAAa,QAAS,SACtB,gBACA,MAAM,OACR,GAcE,OAAO,MAXiB,aACtB,QACA,cACA,MAAM,SACN,gBACA,QACA,KAAA,GACA,OACA,MAAM,cAAc,QAAQ,MAAM,OAAO,CAC3C;AAIJ;;;;;;;;;;AAWA,MAAa,sBAAsB,OACjC,QACA,EAAE,cAAc,OAAO,qBACE;CAEzB,IAAID,4BAAAA,cAAc,MAAM,OAAO,GAC7B;CAUF,IAAI,MARyBC,6BAAAA,aAC3B,QACA,cACA,MAAM,SACN,aAAa,QAAS,SACtB,gBACA,MAAM,OACR,IACqB,GAYnB,OAAO,MAXiB,aACtB,QACA,cACA,MAAM,SACN,gBACA,IACA,KAAA,GACA,OACA,MAAM,cAAc,QAAQ,MAAM,OAAO,CAC3C;AAIJ"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { WalletCallReceipt as WalletCallReceipt$1 } from "../types.js";
|
|
2
2
|
import { Client, Hash } from "viem";
|
|
3
3
|
import { GetCallsStatusReturnType } from "viem/actions";
|
|
4
|
-
//#region src/actions/waitForBatchTransactionReceipt.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Waits until the wallet reports the EIP-5792 call bundle as done or failed.
|
|
7
6
|
*
|
|
@@ -26,6 +25,4 @@ export declare const waitForBatchTransactionReceipt: (client: Client, batchHash:
|
|
|
26
25
|
onFailed?: (result: GetCallsStatusReturnType) => void;
|
|
27
26
|
signedAt?: number;
|
|
28
27
|
callCount?: number;
|
|
29
|
-
}) => Promise<WalletCallReceipt$1>;
|
|
30
|
-
//#endregion
|
|
31
|
-
//# sourceMappingURL=waitForBatchTransactionReceipt.d.ts.map
|
|
28
|
+
}) => Promise<WalletCallReceipt$1>;
|
|
@@ -3,7 +3,7 @@ let _lifi_sdk = require("@lifi/sdk");
|
|
|
3
3
|
let viem = require("viem");
|
|
4
4
|
let viem_actions = require("viem/actions");
|
|
5
5
|
let viem_utils = require("viem/utils");
|
|
6
|
-
|
|
6
|
+
// src/actions/waitForBatchTransactionReceipt.ts
|
|
7
7
|
const DROPPED_BUNDLE_MAX_AGE_MS = 6e5;
|
|
8
8
|
/**
|
|
9
9
|
* viem shares one poll between the waits for the same client and id, and
|
|
@@ -96,7 +96,6 @@ const waitForBatchTransactionReceipt = async (client, batchHash, { onFailed, sig
|
|
|
96
96
|
if (result.statusCode === 500) throw new _lifi_sdk.TransactionError(_lifi_sdk.LiFiErrorCode.TransactionFailed, "Transaction failed.", void 0, { final: true });
|
|
97
97
|
throw new _lifi_sdk.TransactionError(_lifi_sdk.LiFiErrorCode.TransactionFailed, "Transaction failed.");
|
|
98
98
|
};
|
|
99
|
-
//#endregion
|
|
100
99
|
exports.waitForBatchTransactionReceipt = waitForBatchTransactionReceipt;
|
|
101
100
|
|
|
102
101
|
//# sourceMappingURL=waitForBatchTransactionReceipt.js.map
|
|
@@ -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,7 @@ 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
|
-
export declare const waitForRelayedTransactionReceipt: (client: SDKClient, taskId: Hash, step: LiFiStep, timeout?: number, signal?: AbortSignal) => Promise<WalletCallReceipt$1>;
|
|
18
|
-
//#endregion
|
|
19
|
-
//# sourceMappingURL=waitForRelayedTransactionReceipt.d.ts.map
|
|
16
|
+
export declare const waitForRelayedTransactionReceipt: (client: SDKClient, taskId: Hash, step: LiFiStep, timeout?: number, signal?: AbortSignal) => Promise<WalletCallReceipt$1>;
|
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_client_publicClient = require("../client/publicClient.js");
|
|
2
3
|
let _lifi_sdk = require("@lifi/sdk");
|
|
3
|
-
|
|
4
|
+
let viem_actions = require("viem/actions");
|
|
5
|
+
let viem_utils = require("viem/utils");
|
|
6
|
+
// src/actions/waitForRelayedTransactionReceipt.ts
|
|
7
|
+
/**
|
|
8
|
+
* Status errors in a row that end the wait. A failed request, `NOT_FOUND`, the
|
|
9
|
+
* 422/1004 answer of a failed lookup and a source receipt that cannot be
|
|
10
|
+
* loaded each count; a PENDING answer resets the count, so a long relay does
|
|
11
|
+
* not collect errors over its whole wait.
|
|
12
|
+
*/
|
|
13
|
+
const MAX_STATUS_ERRORS = 5;
|
|
14
|
+
/** The on-chain outcome of a source transaction, or `undefined` when its receipt cannot be loaded. */
|
|
15
|
+
const getSourceOutcome = async (client, chainId, hash) => {
|
|
16
|
+
try {
|
|
17
|
+
const publicClient = await require_client_publicClient.getPublicClient(client, chainId);
|
|
18
|
+
return (await (0, viem_utils.getAction)(publicClient, viem_actions.getTransactionReceipt, "getTransactionReceipt")({ hash })).status;
|
|
19
|
+
} catch {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
4
23
|
/**
|
|
5
24
|
* Polls the relayer until the relayed transaction is done or has failed.
|
|
6
25
|
*
|
|
@@ -10,40 +29,59 @@ let _lifi_sdk = require("@lifi/sdk");
|
|
|
10
29
|
* @param timeout - How long to wait for a result in milliseconds. Defaults to 24 hours.
|
|
11
30
|
* @param signal - Ends the wait: no status request starts after it aborts, and the request in flight and the sleep end at once.
|
|
12
31
|
* @returns The receipt of the relayed transaction.
|
|
13
|
-
* @throws {TransactionError} If the transaction failed, was not found, or no result arrived before the timeout. Only the failed transaction is a final outcome.
|
|
32
|
+
* @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.
|
|
14
33
|
* @throws The abort reason of `signal` once it aborts.
|
|
15
34
|
*/
|
|
16
35
|
const waitForRelayedTransactionReceipt = async (client, taskId, step, timeout = 864e5, signal) => {
|
|
17
36
|
const startTime = Date.now();
|
|
37
|
+
const isGasless = (0, _lifi_sdk.isGaslessStep)(step);
|
|
38
|
+
const isCrossChain = step.action.fromChainId !== step.action.toChainId;
|
|
39
|
+
let statusErrors = 0;
|
|
18
40
|
return (0, _lifi_sdk.waitForResult)(async () => {
|
|
19
41
|
if (Date.now() - startTime > timeout) throw new _lifi_sdk.TransactionError(_lifi_sdk.LiFiErrorCode.TransactionFailed, "Relayed transaction timed out waiting for a result.");
|
|
20
|
-
const result = await (0, _lifi_sdk.getRelayedTransactionStatus)(client, {
|
|
42
|
+
const result = await (isGasless ? (0, _lifi_sdk.getStatus)(client, { taskId }, { signal }) : (0, _lifi_sdk.getRelayedTransactionStatus)(client, {
|
|
21
43
|
taskId,
|
|
22
44
|
fromChain: step.action.fromChainId,
|
|
23
45
|
toChain: step.action.toChainId,
|
|
24
46
|
...step.tool !== "custom" && { bridge: step.tool }
|
|
25
|
-
}, { signal }).catch((e) => {
|
|
47
|
+
}, { signal })).catch((e) => {
|
|
26
48
|
if (process.env.NODE_ENV === "development" && !signal?.aborted) console.debug("Fetching status from relayer failed.", e);
|
|
27
49
|
});
|
|
50
|
+
const gaslessStatus = isGasless ? result : void 0;
|
|
51
|
+
const bridgeSource = isCrossChain && gaslessStatus?.sending?.txHash ? {
|
|
52
|
+
status: "success",
|
|
53
|
+
transactionHash: gaslessStatus.sending.txHash,
|
|
54
|
+
transactionLink: gaslessStatus.sending.txLink
|
|
55
|
+
} : void 0;
|
|
56
|
+
const statusError = (error) => {
|
|
57
|
+
statusErrors++;
|
|
58
|
+
if (statusErrors < MAX_STATUS_ERRORS) return;
|
|
59
|
+
throw error;
|
|
60
|
+
};
|
|
28
61
|
switch (result?.status) {
|
|
29
|
-
case "PENDING":
|
|
62
|
+
case "PENDING":
|
|
63
|
+
statusErrors = 0;
|
|
64
|
+
return gaslessStatus?.substatus === "WAIT_DESTINATION_TRANSACTION" ? bridgeSource : void 0;
|
|
30
65
|
case "DONE": {
|
|
31
66
|
const sending = result?.transactionStatus?.sending || result?.sending;
|
|
32
67
|
return {
|
|
33
68
|
status: "success",
|
|
34
69
|
gasUsed: sending?.gasUsed,
|
|
35
|
-
transactionHash: result?.metadata
|
|
70
|
+
transactionHash: result?.metadata?.txHash || sending?.txHash,
|
|
36
71
|
transactionLink: sending?.txLink
|
|
37
72
|
};
|
|
38
73
|
}
|
|
39
|
-
case "FAILED":
|
|
40
|
-
|
|
74
|
+
case "FAILED":
|
|
75
|
+
if (bridgeSource) {
|
|
76
|
+
const outcome = await getSourceOutcome(client, step.action.fromChainId, bridgeSource.transactionHash);
|
|
77
|
+
if (outcome === "success") return bridgeSource;
|
|
78
|
+
if (outcome === void 0) return statusError(new _lifi_sdk.TransactionError(_lifi_sdk.LiFiErrorCode.TransactionFailed, "The relayed transaction failed, and its source transaction could not be checked."));
|
|
79
|
+
}
|
|
80
|
+
throw new _lifi_sdk.TransactionError(_lifi_sdk.LiFiErrorCode.TransactionFailed, "Transaction was reverted.", void 0, { final: true });
|
|
81
|
+
default: return statusError(new _lifi_sdk.TransactionError(_lifi_sdk.LiFiErrorCode.TransactionNotFound, "Transaction not found."));
|
|
41
82
|
}
|
|
42
|
-
}, 5e3,
|
|
43
|
-
return !(error instanceof _lifi_sdk.TransactionError && error.code === _lifi_sdk.LiFiErrorCode.TransactionFailed);
|
|
44
|
-
}, signal);
|
|
83
|
+
}, 5e3, void 0, () => false, signal);
|
|
45
84
|
};
|
|
46
|
-
//#endregion
|
|
47
85
|
exports.waitForRelayedTransactionReceipt = waitForRelayedTransactionReceipt;
|
|
48
86
|
|
|
49
87
|
//# sourceMappingURL=waitForRelayedTransactionReceipt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waitForRelayedTransactionReceipt.js","names":["waitForResult","TransactionError","LiFiErrorCode","getRelayedTransactionStatus"],"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 not an error, so the retry limit does not apply.\n // TransactionFailed is not retried, so this ends the poll. 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 const result = await 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 ).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 switch (result?.status) {\n case 'PENDING':\n return 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 throw new TransactionError(\n LiFiErrorCode.TransactionFailed,\n 'Transaction was reverted.',\n undefined,\n { final: true }\n )\n default:\n throw new TransactionError(\n LiFiErrorCode.TransactionNotFound,\n 'Transaction not found.'\n )\n }\n },\n 5000,\n 3,\n (_, error) => {\n return !(\n error instanceof TransactionError &&\n error.code === LiFiErrorCode.TransactionFailed\n )\n },\n signal\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAyBA,MAAa,mCAAmC,OAC9C,QACA,QACA,MACA,UAAkB,OAClB,WAC+B;CAC/B,MAAM,YAAY,KAAK,IAAI;CAC3B,QAAA,GAAOA,UAAAA,cAAAA,CACL,YAAY;EAMV,IAAI,KAAK,IAAI,IAAI,YAAY,SAC3B,MAAM,IAAIC,UAAAA,iBACRC,UAAAA,cAAc,mBACd,qDACF;EAGF,MAAM,SAAS,OAAA,GAAMC,UAAAA,4BAAAA,CACnB,QACA;GACE;GACA,WAAW,KAAK,OAAO;GACvB,SAAS,KAAK,OAAO;GACrB,GAAI,KAAK,SAAS,YAAY,EAAE,QAAQ,KAAK,KAAK;EACpD,GACA,EAAE,OAAO,CACX,CAAC,CAAC,OAAO,MAAM;GAEb,IAAI,QAAQ,IAAI,aAAa,iBAAiB,CAAC,QAAQ,SACrD,QAAQ,MAAM,wCAAwC,CAAC;EAG3D,CAAC;EAED,QAAQ,QAAQ,QAAhB;GACE,KAAK,WACH;GACF,KAAK,QAAQ;IACX,MAAM,UACH,QAAQ,mBAAmB,WAC1B,QACE;IACN,OAAO;KACL,QAAQ;KACR,SAAS,SAAS;KAClB,iBAAiB,QAAQ,SAAS,UAAU,SAAS;KACrD,iBAAiB,SAAS;IAC5B;GACF;GACA,KAAK,UACH,MAAM,IAAIF,UAAAA,iBACRC,UAAAA,cAAc,mBACd,6BACA,KAAA,GACA,EAAE,OAAO,KAAK,CAChB;GACF,SACE,MAAM,IAAID,UAAAA,iBACRC,UAAAA,cAAc,qBACd,wBACF;EACJ;CACF,GACA,KACA,IACC,GAAG,UAAU;EACZ,OAAO,EACL,iBAAiBD,UAAAA,oBACjB,MAAM,SAASC,UAAAA,cAAc;CAEjC,GACA,MACF;AACF"}
|
|
1
|
+
{"version":3,"file":"waitForRelayedTransactionReceipt.js","names":["getPublicClient","getAction","getTransactionReceipt","isGaslessStep","waitForResult","TransactionError","LiFiErrorCode","getStatus","getRelayedTransactionStatus"],"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,MAAMA,4BAAAA,gBAAgB,QAAQ,OAAO;EAM1D,QAAO,OAAA,GALeC,WAAAA,UAAAA,CACpB,cACAC,aAAAA,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,aAAA,GAAYC,UAAAA,cAAAA,CAAc,IAAI;CACpC,MAAM,eAAe,KAAK,OAAO,gBAAgB,KAAK,OAAO;CAC7D,IAAI,eAAe;CACnB,QAAA,GAAOC,UAAAA,cAAAA,CACL,YAAY;EAMV,IAAI,KAAK,IAAI,IAAI,YAAY,SAC3B,MAAM,IAAIC,UAAAA,iBACRC,UAAAA,cAAc,mBACd,qDACF;EAQF,MAAM,SAAS,OACb,aAAA,GACKC,UAAAA,UAAAA,CACC,QACA,EAAE,OAAO,GACT,EAAE,OAAO,CACX,KAAA,GACAC,UAAAA,4BAAAA,CACE,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,IAAIH,UAAAA,iBACFC,UAAAA,cAAc,mBACd,kFACF,CACF;IAEJ;IACA,MAAM,IAAID,UAAAA,iBACRC,UAAAA,cAAc,mBACd,6BACA,KAAA,GACA,EAAE,OAAO,KAAK,CAChB;GACF,SACE,OAAO,YACL,IAAID,UAAAA,iBACFC,UAAAA,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;
|
|
@@ -17,6 +16,4 @@ export interface WaitForSafeTransactionExecutionProps {
|
|
|
17
16
|
* @returns The on-chain transaction hash once the Safe transaction is executed.
|
|
18
17
|
* @throws {TransactionError} If the transaction fails, is replaced, or polling times out.
|
|
19
18
|
*/
|
|
20
|
-
export declare function waitForSafeTransactionExecution(client: SDKClient, { chainId, safeAddress, signature, pollingInterval, timeout: timeoutMs }: WaitForSafeTransactionExecutionProps): Promise<Hash>;
|
|
21
|
-
//#endregion
|
|
22
|
-
//# sourceMappingURL=waitForSafeTransactionExecution.d.ts.map
|
|
19
|
+
export declare function waitForSafeTransactionExecution(client: SDKClient, { chainId, safeAddress, signature, pollingInterval, timeout: timeoutMs }: WaitForSafeTransactionExecutionProps): Promise<Hash>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_utils_getSafeApiKey = require("../utils/getSafeApiKey.js");
|
|
3
2
|
const require_client_safeClient = require("../client/safeClient.js");
|
|
3
|
+
const require_utils_getSafeApiKey = require("../utils/getSafeApiKey.js");
|
|
4
4
|
let _lifi_sdk = require("@lifi/sdk");
|
|
5
|
-
|
|
5
|
+
// src/actions/waitForSafeTransactionExecution.ts
|
|
6
6
|
/**
|
|
7
7
|
* Polls the Safe Transaction Service until the transaction matching the given signature
|
|
8
8
|
* is executed, then resolves with the on-chain transaction hash.
|
|
@@ -49,7 +49,6 @@ async function waitForSafeTransactionExecution(client, { chainId, safeAddress, s
|
|
|
49
49
|
throw new _lifi_sdk.TransactionError(_lifi_sdk.LiFiErrorCode.TransactionFailed, "Safe transaction timed out waiting for execution.");
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
//#endregion
|
|
53
52
|
exports.waitForSafeTransactionExecution = waitForSafeTransactionExecution;
|
|
54
53
|
|
|
55
54
|
//# 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,4 @@ 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
|
-
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=waitForTransactionReceipt.d.ts.map
|
|
10
|
+
export {};
|
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_client_publicClient = require("../client/publicClient.js");
|
|
3
3
|
let _lifi_sdk = require("@lifi/sdk");
|
|
4
4
|
let viem_actions = require("viem/actions");
|
|
5
|
-
|
|
5
|
+
// src/actions/waitForTransactionReceipt.ts
|
|
6
6
|
async function waitForTransactionReceipt(client, { client: viemClient, chainId, txHash, onReplaced }) {
|
|
7
7
|
let { transactionReceipt, replacementReason } = await waitForReceipt(viemClient, txHash, onReplaced);
|
|
8
8
|
if (!transactionReceipt?.status) {
|
|
@@ -31,7 +31,6 @@ async function waitForReceipt(client, txHash, onReplaced) {
|
|
|
31
31
|
replacementReason
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
//#endregion
|
|
35
34
|
exports.waitForTransactionReceipt = waitForTransactionReceipt;
|
|
36
35
|
|
|
37
36
|
//# sourceMappingURL=waitForTransactionReceipt.js.map
|
|
@@ -1,12 +1,9 @@
|
|
|
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
|
|
7
6
|
* @param chainId - Id of the chain the provider is for
|
|
8
7
|
* @returns The public client for the given chain
|
|
9
8
|
*/
|
|
10
|
-
export declare const getPublicClient: (client: SDKClient, chainId: number) => Promise<Client>;
|
|
11
|
-
//#endregion
|
|
12
|
-
//# sourceMappingURL=publicClient.d.ts.map
|
|
9
|
+
export declare const getPublicClient: (client: SDKClient, chainId: number) => Promise<Client>;
|
|
@@ -3,7 +3,7 @@ const require_actions_constants = require("../actions/constants.js");
|
|
|
3
3
|
let _lifi_sdk = require("@lifi/sdk");
|
|
4
4
|
let viem = require("viem");
|
|
5
5
|
let viem_chains = require("viem/chains");
|
|
6
|
-
|
|
6
|
+
// src/client/publicClient.ts
|
|
7
7
|
const publicClients = /* @__PURE__ */ new Map();
|
|
8
8
|
/**
|
|
9
9
|
* Get an instance of a provider for a specific chain
|
|
@@ -52,7 +52,6 @@ const buildPublicClient = async (client, chainId) => {
|
|
|
52
52
|
batch: { multicall: true }
|
|
53
53
|
});
|
|
54
54
|
};
|
|
55
|
-
//#endregion
|
|
56
55
|
exports.getPublicClient = getPublicClient;
|
|
57
56
|
|
|
58
57
|
//# 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>;
|
|
@@ -10,6 +9,4 @@ export interface SafeClientInterface {
|
|
|
10
9
|
}) => Promise<SafeMultisigTransactionList>;
|
|
11
10
|
}
|
|
12
11
|
export declare const getSafeClient: (chainId: number, apiKey?: string) => SafeClientInterface;
|
|
13
|
-
export type SafeClient = ReturnType<typeof getSafeClient>;
|
|
14
|
-
//#endregion
|
|
15
|
-
//# sourceMappingURL=safeClient.d.ts.map
|
|
12
|
+
export type SafeClient = ReturnType<typeof getSafeClient>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let _lifi_sdk = require("@lifi/sdk");
|
|
3
|
-
|
|
3
|
+
// src/client/safeClient.ts
|
|
4
4
|
const SAFE_CLIENT_GATEWAY = "https://safe-client.safe.global";
|
|
5
5
|
const TX_SERVICE_URL_CACHE_TTL = 36e5;
|
|
6
6
|
const txServiceUrlCache = new _lifi_sdk.LruMap(12);
|
|
@@ -38,7 +38,6 @@ const getSafeClient = (chainId, apiKey) => ({
|
|
|
38
38
|
return request(chainId, `/api/v1/safes/${safeAddress}/multisig-transactions/${qs ? `?${qs}` : ""}`, apiKey);
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
|
-
//#endregion
|
|
42
41
|
exports.getSafeClient = getSafeClient;
|
|
43
42
|
|
|
44
43
|
//# 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[];
|
|
@@ -16,6 +15,4 @@ export interface SafeMultisigTransaction {
|
|
|
16
15
|
export interface SafeMultisigTransactionList {
|
|
17
16
|
count: number;
|
|
18
17
|
results: SafeMultisigTransaction[];
|
|
19
|
-
}
|
|
20
|
-
//#endregion
|
|
21
|
-
//# sourceMappingURL=types.d.ts.map
|
|
18
|
+
}
|
|
@@ -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,4 @@ export declare class EthereumStepExecutor extends BaseStepExecutor {
|
|
|
19
18
|
override createContext: (baseContext: StepExecutorBaseContext) => Promise<EthereumStepExecutorContext>;
|
|
20
19
|
override createPipeline: (context: EthereumStepExecutorContext) => TaskPipeline;
|
|
21
20
|
}
|
|
22
|
-
|
|
23
|
-
export {};
|
|
24
|
-
//# sourceMappingURL=EthereumStepExecutor.d.ts.map
|
|
21
|
+
export {};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_utils_isZeroAddress = require("../utils/isZeroAddress.js");
|
|
3
2
|
const require_errors_parseEthereumErrors = require("../errors/parseEthereumErrors.js");
|
|
4
|
-
const
|
|
5
|
-
const require_core_tasks_EthereumResetAllowanceTask = require("./tasks/EthereumResetAllowanceTask.js");
|
|
6
|
-
const require_core_tasks_EthereumSetAllowanceTask = require("./tasks/EthereumSetAllowanceTask.js");
|
|
7
|
-
const require_core_tasks_helpers_shouldCheckForAllowance = require("./tasks/helpers/shouldCheckForAllowance.js");
|
|
3
|
+
const require_utils_isZeroAddress = require("../utils/isZeroAddress.js");
|
|
8
4
|
const require_core_tasks_EthereumCheckAllowanceAfterPrepareTask = require("./tasks/EthereumCheckAllowanceAfterPrepareTask.js");
|
|
5
|
+
const require_core_tasks_EthereumCheckAllowanceTask = require("./tasks/EthereumCheckAllowanceTask.js");
|
|
9
6
|
const require_core_tasks_EthereumCheckBalanceTask = require("./tasks/EthereumCheckBalanceTask.js");
|
|
10
7
|
const require_core_tasks_EthereumCheckPermitsTask = require("./tasks/EthereumCheckPermitsTask.js");
|
|
11
8
|
const require_core_tasks_EthereumNativePermitTask = require("./tasks/EthereumNativePermitTask.js");
|
|
12
9
|
const require_core_tasks_EthereumPermit2AllowanceTask = require("./tasks/EthereumPermit2AllowanceTask.js");
|
|
13
10
|
const require_core_tasks_EthereumPrepareTransactionTask = require("./tasks/EthereumPrepareTransactionTask.js");
|
|
11
|
+
const require_core_tasks_EthereumResetAllowanceTask = require("./tasks/EthereumResetAllowanceTask.js");
|
|
12
|
+
const require_core_tasks_EthereumSetAllowanceTask = require("./tasks/EthereumSetAllowanceTask.js");
|
|
14
13
|
const require_core_tasks_EthereumSignAndExecuteTask = require("./tasks/EthereumSignAndExecuteTask.js");
|
|
15
14
|
const require_core_tasks_EthereumWaitForTransactionStatusTask = require("./tasks/EthereumWaitForTransactionStatusTask.js");
|
|
16
15
|
const require_core_tasks_EthereumWaitForTransactionTask = require("./tasks/EthereumWaitForTransactionTask.js");
|
|
16
|
+
const require_core_tasks_helpers_shouldCheckForAllowance = require("./tasks/helpers/shouldCheckForAllowance.js");
|
|
17
17
|
const require_core_tasks_helpers_switchChain = require("./tasks/helpers/switchChain.js");
|
|
18
18
|
let _lifi_sdk = require("@lifi/sdk");
|
|
19
19
|
let viem_actions = require("viem/actions");
|
|
20
20
|
let viem_utils = require("viem/utils");
|
|
21
|
-
|
|
21
|
+
// src/core/EthereumStepExecutor.ts
|
|
22
22
|
var EthereumStepExecutor = class extends _lifi_sdk.BaseStepExecutor {
|
|
23
23
|
client;
|
|
24
24
|
switchChain;
|
|
@@ -87,7 +87,6 @@ var EthereumStepExecutor = class extends _lifi_sdk.BaseStepExecutor {
|
|
|
87
87
|
return new _lifi_sdk.TaskPipeline(tasksToRun);
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
|
-
//#endregion
|
|
91
90
|
exports.EthereumStepExecutor = EthereumStepExecutor;
|
|
92
91
|
|
|
93
92
|
//# sourceMappingURL=EthereumStepExecutor.js.map
|