@lifi/sdk-provider-ethereum 4.0.4 → 4.0.6
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 +12 -0
- package/dist/cjs/EthereumProvider.d.ts +0 -1
- package/dist/cjs/actions/checkPermitSupport.d.ts +16 -20
- package/dist/cjs/actions/constants.d.ts +0 -1
- package/dist/cjs/actions/getAccountCode.d.ts +13 -18
- package/dist/cjs/actions/getAllowance.d.ts +13 -14
- package/dist/cjs/actions/getEthereumBalance.d.ts +0 -1
- package/dist/cjs/actions/getMaxPriorityFeePerGas.d.ts +0 -1
- package/dist/cjs/actions/getMulticallAddress.d.ts +0 -1
- package/dist/cjs/actions/isBatchingSupported.d.ts +1 -6
- package/dist/cjs/actions/isSafeSignature.d.ts +6 -11
- package/dist/cjs/actions/isSafeWallet.d.ts +4 -10
- package/dist/cjs/actions/isSmartContractWallet.d.ts +4 -4
- package/dist/cjs/actions/resolveENSAddress.d.ts +0 -1
- package/dist/cjs/actions/resolveEthereumAddress.d.ts +0 -1
- package/dist/cjs/actions/resolveTransactionHash.d.ts +0 -1
- package/dist/cjs/actions/resolveUNSAddress.d.ts +0 -1
- package/dist/cjs/actions/setAllowance.d.ts +19 -29
- package/dist/cjs/actions/waitForBatchTransactionReceipt.d.ts +0 -1
- package/dist/cjs/actions/waitForRelayedTransactionReceipt.d.ts +0 -1
- package/dist/cjs/actions/waitForSafeTransactionExecution.d.ts +9 -16
- package/dist/cjs/actions/waitForTransactionReceipt.d.ts +1 -7
- package/dist/cjs/client/publicClient.d.ts +5 -6
- package/dist/cjs/client/safeClient.d.ts +0 -1
- package/dist/cjs/core/EthereumStepExecutor.d.ts +0 -1
- package/dist/cjs/core/tasks/EthereumBatchedSignAndExecuteTask.d.ts +0 -1
- package/dist/cjs/core/tasks/EthereumBatchedWaitForTransactionTask.d.ts +0 -1
- package/dist/cjs/core/tasks/EthereumCheckAllowanceTask.d.ts +0 -1
- package/dist/cjs/core/tasks/EthereumCheckBalanceTask.d.ts +8 -9
- package/dist/cjs/core/tasks/EthereumCheckPermitsTask.d.ts +0 -1
- package/dist/cjs/core/tasks/EthereumCheckPermitsTask.js +2 -0
- package/dist/cjs/core/tasks/EthereumCheckPermitsTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumNativePermitTask.d.ts +0 -1
- package/dist/cjs/core/tasks/EthereumNativePermitTask.js +5 -0
- package/dist/cjs/core/tasks/EthereumNativePermitTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumPrepareTransactionTask.d.ts +0 -1
- package/dist/cjs/core/tasks/EthereumRelayedSignAndExecuteTask.d.ts +0 -1
- package/dist/cjs/core/tasks/EthereumRelayedSignAndExecuteTask.js +2 -0
- package/dist/cjs/core/tasks/EthereumRelayedSignAndExecuteTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumRelayedWaitForTransactionTask.d.ts +0 -1
- package/dist/cjs/core/tasks/EthereumResetAllowanceTask.d.ts +0 -1
- package/dist/cjs/core/tasks/EthereumSetAllowanceTask.d.ts +0 -1
- package/dist/cjs/core/tasks/EthereumSignAndExecuteTask.d.ts +0 -1
- package/dist/cjs/core/tasks/EthereumStandardSignAndExecuteTask.d.ts +0 -1
- package/dist/cjs/core/tasks/EthereumStandardSignAndExecuteTask.js +2 -1
- package/dist/cjs/core/tasks/EthereumStandardSignAndExecuteTask.js.map +1 -1
- package/dist/cjs/core/tasks/EthereumStandardWaitForTransactionTask.d.ts +0 -1
- package/dist/cjs/core/tasks/EthereumWaitForTransactionStatusTask.d.ts +0 -1
- package/dist/cjs/core/tasks/EthereumWaitForTransactionTask.d.ts +0 -1
- package/dist/cjs/core/tasks/helpers/estimateTransactionRequest.d.ts +0 -1
- package/dist/cjs/core/tasks/helpers/getEthereumExecutionStrategy.d.ts +4 -5
- package/dist/cjs/core/tasks/helpers/getTxLink.d.ts +0 -1
- package/dist/cjs/core/tasks/helpers/getUpdatedStep.d.ts +0 -1
- package/dist/cjs/core/tasks/helpers/isPermit2Supported.d.ts +0 -1
- package/dist/cjs/core/tasks/helpers/shouldCheckForAllowance.d.ts +0 -1
- package/dist/cjs/core/tasks/helpers/signHyperliquidTypedData.d.ts +0 -1
- package/dist/cjs/core/tasks/helpers/signHyperliquidTypedData.js +3 -0
- package/dist/cjs/core/tasks/helpers/signHyperliquidTypedData.js.map +1 -1
- package/dist/cjs/core/tasks/helpers/switchChain.d.ts +15 -16
- package/dist/cjs/core/tasks/helpers/updateActionWithReceipt.d.ts +3 -4
- package/dist/cjs/errors/parseEthereumErrors.d.ts +0 -1
- package/dist/cjs/hyperliquid/agentWallet.d.ts +0 -1
- package/dist/cjs/hyperliquid/isHyperliquidAgentStep.d.ts +0 -1
- package/dist/cjs/permits/allowanceTransfer.d.ts +0 -1
- package/dist/cjs/permits/canAccountUseNativePermits.d.ts +5 -6
- package/dist/cjs/permits/constants.d.ts +19 -20
- package/dist/cjs/permits/domain.d.ts +0 -1
- package/dist/cjs/permits/encodeNativePermitData.d.ts +0 -1
- package/dist/cjs/permits/encodePermit2Data.d.ts +0 -1
- package/dist/cjs/permits/getNativePermit.d.ts +1 -8
- package/dist/cjs/permits/getPermitTransferFromValues.d.ts +0 -1
- package/dist/cjs/permits/invariant.d.ts +14 -14
- package/dist/cjs/permits/isDelegationDesignatorCode.d.ts +20 -20
- package/dist/cjs/permits/isNativePermitValid.d.ts +2 -3
- package/dist/cjs/permits/isNativePermitValid.js +2 -0
- package/dist/cjs/permits/isNativePermitValid.js.map +1 -1
- package/dist/cjs/permits/signPermit2Message.d.ts +0 -1
- package/dist/cjs/permits/signPermit2Message.js +2 -0
- package/dist/cjs/permits/signPermit2Message.js.map +1 -1
- package/dist/cjs/permits/signatureTransfer.d.ts +0 -1
- package/dist/cjs/permits/types.d.ts +0 -1
- package/dist/cjs/types.d.ts +0 -1
- package/dist/cjs/utils/abi.d.ts +0 -1
- package/dist/cjs/utils/convertExtendedChain.d.ts +0 -1
- package/dist/cjs/utils/getActionWithFallback.d.ts +13 -14
- package/dist/cjs/utils/getDomainChainId.d.ts +4 -5
- package/dist/cjs/utils/getSafeApiKey.d.ts +0 -1
- package/dist/cjs/utils/isContractCallStep.d.ts +0 -1
- package/dist/cjs/utils/isExtendedChain.d.ts +0 -1
- package/dist/cjs/utils/isGaslessStep.d.ts +0 -1
- package/dist/cjs/utils/isRelayerStep.d.ts +0 -1
- package/dist/cjs/utils/isValidSignature.d.ts +14 -0
- package/dist/cjs/utils/isValidSignature.js +22 -0
- package/dist/cjs/utils/isValidSignature.js.map +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/EthereumProvider.d.ts +0 -1
- package/dist/esm/EthereumProvider.d.ts.map +1 -1
- package/dist/esm/actions/checkPermitSupport.d.ts +16 -20
- package/dist/esm/actions/checkPermitSupport.d.ts.map +1 -1
- package/dist/esm/actions/constants.d.ts +0 -1
- package/dist/esm/actions/constants.d.ts.map +1 -1
- package/dist/esm/actions/getAccountCode.d.ts +13 -18
- package/dist/esm/actions/getAccountCode.d.ts.map +1 -1
- package/dist/esm/actions/getAllowance.d.ts +13 -14
- package/dist/esm/actions/getAllowance.d.ts.map +1 -1
- package/dist/esm/actions/getEthereumBalance.d.ts +0 -1
- package/dist/esm/actions/getEthereumBalance.d.ts.map +1 -1
- package/dist/esm/actions/getMaxPriorityFeePerGas.d.ts +0 -1
- package/dist/esm/actions/getMaxPriorityFeePerGas.d.ts.map +1 -1
- package/dist/esm/actions/getMulticallAddress.d.ts +0 -1
- package/dist/esm/actions/getMulticallAddress.d.ts.map +1 -1
- package/dist/esm/actions/isBatchingSupported.d.ts +1 -6
- package/dist/esm/actions/isBatchingSupported.d.ts.map +1 -1
- package/dist/esm/actions/isSafeSignature.d.ts +6 -11
- package/dist/esm/actions/isSafeSignature.d.ts.map +1 -1
- package/dist/esm/actions/isSafeWallet.d.ts +4 -10
- package/dist/esm/actions/isSafeWallet.d.ts.map +1 -1
- package/dist/esm/actions/isSmartContractWallet.d.ts +4 -4
- package/dist/esm/actions/isSmartContractWallet.d.ts.map +1 -1
- package/dist/esm/actions/resolveENSAddress.d.ts +0 -1
- package/dist/esm/actions/resolveENSAddress.d.ts.map +1 -1
- package/dist/esm/actions/resolveEthereumAddress.d.ts +0 -1
- package/dist/esm/actions/resolveEthereumAddress.d.ts.map +1 -1
- package/dist/esm/actions/resolveTransactionHash.d.ts +0 -1
- package/dist/esm/actions/resolveTransactionHash.d.ts.map +1 -1
- package/dist/esm/actions/resolveUNSAddress.d.ts +0 -1
- package/dist/esm/actions/resolveUNSAddress.d.ts.map +1 -1
- package/dist/esm/actions/setAllowance.d.ts +19 -29
- package/dist/esm/actions/setAllowance.d.ts.map +1 -1
- package/dist/esm/actions/waitForBatchTransactionReceipt.d.ts +0 -1
- package/dist/esm/actions/waitForBatchTransactionReceipt.d.ts.map +1 -1
- package/dist/esm/actions/waitForRelayedTransactionReceipt.d.ts +0 -1
- package/dist/esm/actions/waitForRelayedTransactionReceipt.d.ts.map +1 -1
- package/dist/esm/actions/waitForSafeTransactionExecution.d.ts +9 -16
- package/dist/esm/actions/waitForSafeTransactionExecution.d.ts.map +1 -1
- package/dist/esm/actions/waitForTransactionReceipt.d.ts +1 -7
- package/dist/esm/actions/waitForTransactionReceipt.d.ts.map +1 -1
- package/dist/esm/client/publicClient.d.ts +5 -6
- package/dist/esm/client/publicClient.d.ts.map +1 -1
- package/dist/esm/client/safeClient.d.ts +0 -1
- package/dist/esm/client/safeClient.d.ts.map +1 -1
- package/dist/esm/client/types.d.ts.map +1 -1
- package/dist/esm/core/EthereumStepExecutor.d.ts +0 -1
- package/dist/esm/core/EthereumStepExecutor.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumBatchedSignAndExecuteTask.d.ts +0 -1
- package/dist/esm/core/tasks/EthereumBatchedSignAndExecuteTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumBatchedWaitForTransactionTask.d.ts +0 -1
- package/dist/esm/core/tasks/EthereumBatchedWaitForTransactionTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumCheckAllowanceTask.d.ts +0 -1
- package/dist/esm/core/tasks/EthereumCheckAllowanceTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumCheckBalanceTask.d.ts +8 -9
- package/dist/esm/core/tasks/EthereumCheckBalanceTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumCheckPermitsTask.d.ts +0 -1
- package/dist/esm/core/tasks/EthereumCheckPermitsTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumCheckPermitsTask.js +2 -0
- package/dist/esm/core/tasks/EthereumCheckPermitsTask.js.map +1 -1
- package/dist/esm/core/tasks/EthereumNativePermitTask.d.ts +0 -1
- package/dist/esm/core/tasks/EthereumNativePermitTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumNativePermitTask.js +5 -0
- package/dist/esm/core/tasks/EthereumNativePermitTask.js.map +1 -1
- package/dist/esm/core/tasks/EthereumPrepareTransactionTask.d.ts +0 -1
- package/dist/esm/core/tasks/EthereumPrepareTransactionTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumRelayedSignAndExecuteTask.d.ts +0 -1
- package/dist/esm/core/tasks/EthereumRelayedSignAndExecuteTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumRelayedSignAndExecuteTask.js +2 -0
- package/dist/esm/core/tasks/EthereumRelayedSignAndExecuteTask.js.map +1 -1
- package/dist/esm/core/tasks/EthereumRelayedWaitForTransactionTask.d.ts +0 -1
- package/dist/esm/core/tasks/EthereumRelayedWaitForTransactionTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumResetAllowanceTask.d.ts +0 -1
- package/dist/esm/core/tasks/EthereumResetAllowanceTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumSetAllowanceTask.d.ts +0 -1
- package/dist/esm/core/tasks/EthereumSetAllowanceTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumSignAndExecuteTask.d.ts +0 -1
- package/dist/esm/core/tasks/EthereumSignAndExecuteTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumStandardSignAndExecuteTask.d.ts +0 -1
- package/dist/esm/core/tasks/EthereumStandardSignAndExecuteTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumStandardSignAndExecuteTask.js +2 -1
- package/dist/esm/core/tasks/EthereumStandardSignAndExecuteTask.js.map +1 -1
- package/dist/esm/core/tasks/EthereumStandardWaitForTransactionTask.d.ts +0 -1
- package/dist/esm/core/tasks/EthereumStandardWaitForTransactionTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumWaitForTransactionStatusTask.d.ts +0 -1
- package/dist/esm/core/tasks/EthereumWaitForTransactionStatusTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/EthereumWaitForTransactionTask.d.ts +0 -1
- package/dist/esm/core/tasks/EthereumWaitForTransactionTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/estimateTransactionRequest.d.ts +0 -1
- package/dist/esm/core/tasks/helpers/estimateTransactionRequest.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/getEthereumExecutionStrategy.d.ts +4 -5
- package/dist/esm/core/tasks/helpers/getEthereumExecutionStrategy.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/getTxLink.d.ts +0 -1
- package/dist/esm/core/tasks/helpers/getTxLink.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/getUpdatedStep.d.ts +0 -1
- package/dist/esm/core/tasks/helpers/getUpdatedStep.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/isPermit2Supported.d.ts +0 -1
- package/dist/esm/core/tasks/helpers/isPermit2Supported.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/shouldCheckForAllowance.d.ts +0 -1
- package/dist/esm/core/tasks/helpers/shouldCheckForAllowance.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/signHyperliquidTypedData.d.ts +0 -1
- package/dist/esm/core/tasks/helpers/signHyperliquidTypedData.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/signHyperliquidTypedData.js +3 -0
- package/dist/esm/core/tasks/helpers/signHyperliquidTypedData.js.map +1 -1
- package/dist/esm/core/tasks/helpers/switchChain.d.ts +15 -16
- package/dist/esm/core/tasks/helpers/switchChain.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/updateActionWithReceipt.d.ts +3 -4
- package/dist/esm/core/tasks/helpers/updateActionWithReceipt.d.ts.map +1 -1
- package/dist/esm/errors/parseEthereumErrors.d.ts +0 -1
- package/dist/esm/errors/parseEthereumErrors.d.ts.map +1 -1
- package/dist/esm/hyperliquid/agentWallet.d.ts +0 -1
- package/dist/esm/hyperliquid/agentWallet.d.ts.map +1 -1
- package/dist/esm/hyperliquid/isHyperliquidAgentStep.d.ts +0 -1
- package/dist/esm/hyperliquid/isHyperliquidAgentStep.d.ts.map +1 -1
- package/dist/esm/permits/allowanceTransfer.d.ts +0 -1
- package/dist/esm/permits/allowanceTransfer.d.ts.map +1 -1
- package/dist/esm/permits/canAccountUseNativePermits.d.ts +5 -6
- package/dist/esm/permits/canAccountUseNativePermits.d.ts.map +1 -1
- package/dist/esm/permits/constants.d.ts +19 -20
- package/dist/esm/permits/constants.d.ts.map +1 -1
- package/dist/esm/permits/domain.d.ts +0 -1
- package/dist/esm/permits/domain.d.ts.map +1 -1
- package/dist/esm/permits/encodeNativePermitData.d.ts +0 -1
- package/dist/esm/permits/encodeNativePermitData.d.ts.map +1 -1
- package/dist/esm/permits/encodePermit2Data.d.ts +0 -1
- package/dist/esm/permits/encodePermit2Data.d.ts.map +1 -1
- package/dist/esm/permits/getNativePermit.d.ts +1 -8
- package/dist/esm/permits/getNativePermit.d.ts.map +1 -1
- package/dist/esm/permits/getPermitTransferFromValues.d.ts +0 -1
- package/dist/esm/permits/getPermitTransferFromValues.d.ts.map +1 -1
- package/dist/esm/permits/invariant.d.ts +14 -14
- package/dist/esm/permits/invariant.d.ts.map +1 -1
- package/dist/esm/permits/isDelegationDesignatorCode.d.ts +20 -20
- package/dist/esm/permits/isDelegationDesignatorCode.d.ts.map +1 -1
- package/dist/esm/permits/isNativePermitValid.d.ts +2 -3
- package/dist/esm/permits/isNativePermitValid.d.ts.map +1 -1
- package/dist/esm/permits/isNativePermitValid.js +2 -0
- package/dist/esm/permits/isNativePermitValid.js.map +1 -1
- package/dist/esm/permits/signPermit2Message.d.ts +0 -1
- package/dist/esm/permits/signPermit2Message.d.ts.map +1 -1
- package/dist/esm/permits/signPermit2Message.js +2 -0
- package/dist/esm/permits/signPermit2Message.js.map +1 -1
- package/dist/esm/permits/signatureTransfer.d.ts +0 -1
- package/dist/esm/permits/signatureTransfer.d.ts.map +1 -1
- package/dist/esm/permits/types.d.ts +0 -1
- package/dist/esm/permits/types.d.ts.map +1 -1
- package/dist/esm/types.d.ts +0 -1
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/esm/utils/abi.d.ts +0 -1
- package/dist/esm/utils/abi.d.ts.map +1 -1
- package/dist/esm/utils/convertExtendedChain.d.ts +0 -1
- package/dist/esm/utils/convertExtendedChain.d.ts.map +1 -1
- package/dist/esm/utils/getActionWithFallback.d.ts +13 -14
- package/dist/esm/utils/getActionWithFallback.d.ts.map +1 -1
- package/dist/esm/utils/getDomainChainId.d.ts +4 -5
- package/dist/esm/utils/getDomainChainId.d.ts.map +1 -1
- package/dist/esm/utils/getSafeApiKey.d.ts +0 -1
- package/dist/esm/utils/getSafeApiKey.d.ts.map +1 -1
- package/dist/esm/utils/isContractCallStep.d.ts +0 -1
- package/dist/esm/utils/isContractCallStep.d.ts.map +1 -1
- package/dist/esm/utils/isExtendedChain.d.ts +0 -1
- package/dist/esm/utils/isExtendedChain.d.ts.map +1 -1
- package/dist/esm/utils/isGaslessStep.d.ts +0 -1
- package/dist/esm/utils/isGaslessStep.d.ts.map +1 -1
- package/dist/esm/utils/isRelayerStep.d.ts +0 -1
- package/dist/esm/utils/isRelayerStep.d.ts.map +1 -1
- package/dist/esm/utils/isValidSignature.d.ts +14 -0
- package/dist/esm/utils/isValidSignature.d.ts.map +1 -0
- package/dist/esm/utils/isValidSignature.js +20 -0
- package/dist/esm/utils/isValidSignature.js.map +1 -0
- package/dist/esm/utils/isZeroAddress.d.ts.map +1 -1
- package/dist/esm/utils/median.d.ts.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.d.ts.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/package.json +2 -2
- package/src/core/tasks/EthereumCheckPermitsTask.ts +2 -0
- package/src/core/tasks/EthereumNativePermitTask.ts +9 -0
- package/src/core/tasks/EthereumRelayedSignAndExecuteTask.ts +3 -0
- package/src/core/tasks/EthereumStandardSignAndExecuteTask.ts +3 -1
- package/src/core/tasks/helpers/signHyperliquidTypedData.ts +3 -0
- package/src/permits/isNativePermitValid.ts +6 -0
- package/src/permits/signPermit2Message.ts +3 -0
- package/src/utils/isValidSignature.ts +26 -0
- package/src/version.ts +1 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SDKClient } from "@lifi/sdk";
|
|
2
2
|
import { Address } from "viem";
|
|
3
|
-
|
|
4
3
|
//#region src/actions/isSafeWallet.d.ts
|
|
5
4
|
type IsSafeWalletParams = {
|
|
6
5
|
client: SDKClient;
|
|
@@ -9,15 +8,10 @@ type IsSafeWalletParams = {
|
|
|
9
8
|
safeApiKey?: string;
|
|
10
9
|
};
|
|
11
10
|
/**
|
|
12
|
-
* Check if an address is a Safe wallet via the Safe Transaction Service,
|
|
13
|
-
* short-circuiting on `eth_getCode` for EOAs (incl. EIP-7702 delegated).
|
|
14
|
-
*/
|
|
15
|
-
declare function isSafeWallet({
|
|
16
|
-
client,
|
|
17
|
-
chainId,
|
|
18
|
-
address,
|
|
19
|
-
safeApiKey
|
|
20
|
-
}: IsSafeWalletParams): Promise<boolean>;
|
|
11
|
+
* Check if an address is a Safe wallet via the Safe Transaction Service,
|
|
12
|
+
* short-circuiting on `eth_getCode` for EOAs (incl. EIP-7702 delegated).
|
|
13
|
+
*/
|
|
14
|
+
declare function isSafeWallet({ client, chainId, address, safeApiKey }: IsSafeWalletParams): Promise<boolean>;
|
|
21
15
|
//#endregion
|
|
22
16
|
export { isSafeWallet };
|
|
23
17
|
//# sourceMappingURL=isSafeWallet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isSafeWallet.d.ts","names":[],"sources":["../../../src/actions/isSafeWallet.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"isSafeWallet.d.ts","names":[],"sources":["../../../src/actions/isSafeWallet.ts"],"mappings":";;;KAUK;EACH,QAAQ;EACR;EACA,SAAS;EACT;;;;;;iBAOoB,eACpB,QACA,SACA,SACA,cACC,qBAAqB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
//#region src/actions/isSmartContractWallet.d.ts
|
|
2
2
|
/**
|
|
3
|
-
* True iff the code is a smart-contract wallet (Safe, ERC-4337, ERC-7579,
|
|
4
|
-
* custom). Plain EOAs and EIP-7702 delegated EOAs (which still pay their
|
|
5
|
-
* own gas / can sign ECDSA) return false.
|
|
6
|
-
*/
|
|
3
|
+
* True iff the code is a smart-contract wallet (Safe, ERC-4337, ERC-7579,
|
|
4
|
+
* custom). Plain EOAs and EIP-7702 delegated EOAs (which still pay their
|
|
5
|
+
* own gas / can sign ECDSA) return false.
|
|
6
|
+
*/
|
|
7
7
|
declare const isSmartContractWalletCode: (code?: string) => boolean;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { isSmartContractWalletCode };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isSmartContractWallet.d.ts","names":[],"sources":["../../../src/actions/isSmartContractWallet.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"isSmartContractWallet.d.ts","names":[],"sources":["../../../src/actions/isSmartContractWallet.ts"],"mappings":";;;;;;cAOa,4BAA6B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveENSAddress.d.ts","names":[],"sources":["../../../src/actions/resolveENSAddress.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolveENSAddress.d.ts","names":[],"sources":["../../../src/actions/resolveENSAddress.ts"],"mappings":";;cAIa,oBACX,QAAQ,WACR,iBACC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveEthereumAddress.d.ts","names":[],"sources":["../../../src/actions/resolveEthereumAddress.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolveEthereumAddress.d.ts","names":[],"sources":["../../../src/actions/resolveEthereumAddress.ts"],"mappings":";;iBASsB,uBACpB,cACA,QAAQ,WACR,UAAU,SACV,QAAQ,UACP"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SDKClient } from "@lifi/sdk";
|
|
2
2
|
import { Client, Hash } from "viem";
|
|
3
|
-
|
|
4
3
|
//#region src/actions/resolveTransactionHash.d.ts
|
|
5
4
|
declare const resolveTransactionHash: (client: SDKClient, viemClient: Client, txHashOrSignature: Hash, chainId: number) => Promise<Hash>;
|
|
6
5
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveTransactionHash.d.ts","names":[],"sources":["../../../src/actions/resolveTransactionHash.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolveTransactionHash.d.ts","names":[],"sources":["../../../src/actions/resolveTransactionHash.ts"],"mappings":";;;cAKa,yBACX,QAAQ,WACR,YAAY,QACZ,mBAAmB,MACnB,oBACC,QAAQ"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ChainId, ChainType, CoinKey, SDKClient } from "@lifi/sdk";
|
|
2
|
-
|
|
3
2
|
//#region src/actions/resolveUNSAddress.d.ts
|
|
4
3
|
declare const resolveUNSAddress: (client: SDKClient, name: string, chainType: ChainType, chain?: ChainId, token?: CoinKey) => Promise<string | undefined>;
|
|
5
4
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveUNSAddress.d.ts","names":[],"sources":["../../../src/actions/resolveUNSAddress.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolveUNSAddress.d.ts","names":[],"sources":["../../../src/actions/resolveUNSAddress.ts"],"mappings":";;cAmBa,oBACX,QAAQ,WACR,cACA,WAAW,WACX,QAAQ,SACR,QAAQ,YACP"}
|
|
@@ -1,39 +1,29 @@
|
|
|
1
1
|
import { ApproveTokenRequest, RevokeApprovalRequest } from "../types.js";
|
|
2
2
|
import { ExecutionOptions, SDKClient } from "@lifi/sdk";
|
|
3
3
|
import { Address, Client, Hash, Hex } from "viem";
|
|
4
|
-
|
|
5
4
|
//#region src/actions/setAllowance.d.ts
|
|
6
5
|
declare const setAllowance: (client: SDKClient, viemClient: Client, tokenAddress: Address, contractAddress: Address, amount: bigint, executionOptions?: ExecutionOptions, returnPopulatedTransaction?: boolean) => Promise<Hash | Hex>;
|
|
7
6
|
/**
|
|
8
|
-
* Set approval for a certain token and amount.
|
|
9
|
-
* @param client - The SDK client
|
|
10
|
-
* @param request - The approval request
|
|
11
|
-
* @param request.walletClient - The Viem wallet client used to send the transaction
|
|
12
|
-
* @param request.token - The token for which to set the allowance
|
|
13
|
-
* @param request.spenderAddress - The address of the spender
|
|
14
|
-
* @param request.amount - The amount of tokens to approve
|
|
15
|
-
* @returns Returns Hash or nothing
|
|
16
|
-
*/
|
|
17
|
-
declare const setTokenAllowance: (client: SDKClient, {
|
|
18
|
-
walletClient,
|
|
19
|
-
token,
|
|
20
|
-
spenderAddress,
|
|
21
|
-
amount
|
|
22
|
-
}: ApproveTokenRequest) => Promise<Hash | void>;
|
|
7
|
+
* Set approval for a certain token and amount.
|
|
8
|
+
* @param client - The SDK client
|
|
9
|
+
* @param request - The approval request
|
|
10
|
+
* @param request.walletClient - The Viem wallet client used to send the transaction
|
|
11
|
+
* @param request.token - The token for which to set the allowance
|
|
12
|
+
* @param request.spenderAddress - The address of the spender
|
|
13
|
+
* @param request.amount - The amount of tokens to approve
|
|
14
|
+
* @returns Returns Hash or nothing
|
|
15
|
+
*/
|
|
16
|
+
declare const setTokenAllowance: (client: SDKClient, { walletClient, token, spenderAddress, amount }: ApproveTokenRequest) => Promise<Hash | void>;
|
|
23
17
|
/**
|
|
24
|
-
* Revoke approval for a certain token.
|
|
25
|
-
* @param client - The SDK client
|
|
26
|
-
* @param request - The revoke request
|
|
27
|
-
* @param request.walletClient - The Viem wallet client used to send the transaction
|
|
28
|
-
* @param request.token - The token for which to revoke the allowance
|
|
29
|
-
* @param request.spenderAddress - The address of the spender
|
|
30
|
-
* @returns Returns Hash or nothing
|
|
31
|
-
*/
|
|
32
|
-
declare const revokeTokenApproval: (client: SDKClient, {
|
|
33
|
-
walletClient,
|
|
34
|
-
token,
|
|
35
|
-
spenderAddress
|
|
36
|
-
}: RevokeApprovalRequest) => Promise<Hash | void>;
|
|
18
|
+
* Revoke approval for a certain token.
|
|
19
|
+
* @param client - The SDK client
|
|
20
|
+
* @param request - The revoke request
|
|
21
|
+
* @param request.walletClient - The Viem wallet client used to send the transaction
|
|
22
|
+
* @param request.token - The token for which to revoke the allowance
|
|
23
|
+
* @param request.spenderAddress - The address of the spender
|
|
24
|
+
* @returns Returns Hash or nothing
|
|
25
|
+
*/
|
|
26
|
+
declare const revokeTokenApproval: (client: SDKClient, { walletClient, token, spenderAddress }: RevokeApprovalRequest) => Promise<Hash | void>;
|
|
37
27
|
//#endregion
|
|
38
28
|
export { revokeTokenApproval, setAllowance, setTokenAllowance };
|
|
39
29
|
//# sourceMappingURL=setAllowance.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setAllowance.d.ts","names":[],"sources":["../../../src/actions/setAllowance.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"setAllowance.d.ts","names":[],"sources":["../../../src/actions/setAllowance.ts"],"mappings":";;;;cAqBa,eACX,QAAQ,WACR,YAAY,QACZ,cAAc,SACd,iBAAiB,SACjB,gBACA,mBAAmB,kBACnB,yCACC,QAAQ,OAAO;;;;;;;;;;;cA0DL,oBACX,QAAQ,aACN,cAAc,OAAO,gBAAgB,UAAU,wBAChD,QAAQ;;;;;;;;;;cAmCE,sBACX,QAAQ,aACN,cAAc,OAAO,kBAAkB,0BACxC,QAAQ"}
|
|
@@ -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
|
-
|
|
5
4
|
//#region src/actions/waitForBatchTransactionReceipt.d.ts
|
|
6
5
|
declare const waitForBatchTransactionReceipt: (client: Client, batchHash: Hash, onFailed?: (result: GetCallsStatusReturnType) => void) => Promise<WalletCallReceipt$1>;
|
|
7
6
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waitForBatchTransactionReceipt.d.ts","names":[],"sources":["../../../src/actions/waitForBatchTransactionReceipt.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"waitForBatchTransactionReceipt.d.ts","names":[],"sources":["../../../src/actions/waitForBatchTransactionReceipt.ts"],"mappings":";;;;cAMa,iCACX,QAAQ,QACR,WAAW,MACX,YAAY,QAAQ,sCACnB,QAAQ"}
|
|
@@ -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
|
-
|
|
5
4
|
//#region src/actions/waitForRelayedTransactionReceipt.d.ts
|
|
6
5
|
declare const waitForRelayedTransactionReceipt: (client: SDKClient, taskId: Hash, step: LiFiStep) => Promise<WalletCallReceipt$1>;
|
|
7
6
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waitForRelayedTransactionReceipt.d.ts","names":[],"sources":["../../../src/actions/waitForRelayedTransactionReceipt.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"waitForRelayedTransactionReceipt.d.ts","names":[],"sources":["../../../src/actions/waitForRelayedTransactionReceipt.ts"],"mappings":";;;;cAaa,mCACX,QAAQ,WACR,QAAQ,MACR,MAAM,aACL,QAAQ"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SDKClient } from "@lifi/sdk";
|
|
2
2
|
import { Address, Hash } from "viem";
|
|
3
|
-
|
|
4
3
|
//#region src/actions/waitForSafeTransactionExecution.d.ts
|
|
5
4
|
interface WaitForSafeTransactionExecutionProps {
|
|
6
5
|
chainId: number;
|
|
@@ -10,21 +9,15 @@ interface WaitForSafeTransactionExecutionProps {
|
|
|
10
9
|
timeout?: number;
|
|
11
10
|
}
|
|
12
11
|
/**
|
|
13
|
-
* Polls the Safe Transaction Service until the transaction matching the given signature
|
|
14
|
-
* is executed, then resolves with the on-chain transaction hash.
|
|
15
|
-
*
|
|
16
|
-
* @param client - {@link SDKClient}
|
|
17
|
-
* @param props - {@link WaitForSafeTransactionExecutionProps}
|
|
18
|
-
* @returns The on-chain transaction hash once the Safe transaction is executed.
|
|
19
|
-
* @throws {TransactionError} If the transaction fails, is replaced, or polling times out.
|
|
20
|
-
*/
|
|
21
|
-
declare function waitForSafeTransactionExecution(client: SDKClient, {
|
|
22
|
-
chainId,
|
|
23
|
-
safeAddress,
|
|
24
|
-
signature,
|
|
25
|
-
pollingInterval,
|
|
26
|
-
timeout: timeoutMs
|
|
27
|
-
}: WaitForSafeTransactionExecutionProps): Promise<Hash>;
|
|
12
|
+
* Polls the Safe Transaction Service until the transaction matching the given signature
|
|
13
|
+
* is executed, then resolves with the on-chain transaction hash.
|
|
14
|
+
*
|
|
15
|
+
* @param client - {@link SDKClient}
|
|
16
|
+
* @param props - {@link WaitForSafeTransactionExecutionProps}
|
|
17
|
+
* @returns The on-chain transaction hash once the Safe transaction is executed.
|
|
18
|
+
* @throws {TransactionError} If the transaction fails, is replaced, or polling times out.
|
|
19
|
+
*/
|
|
20
|
+
declare function waitForSafeTransactionExecution(client: SDKClient, { chainId, safeAddress, signature, pollingInterval, timeout: timeoutMs }: WaitForSafeTransactionExecutionProps): Promise<Hash>;
|
|
28
21
|
//#endregion
|
|
29
22
|
export { WaitForSafeTransactionExecutionProps, waitForSafeTransactionExecution };
|
|
30
23
|
//# sourceMappingURL=waitForSafeTransactionExecution.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waitForSafeTransactionExecution.d.ts","names":[],"sources":["../../../src/actions/waitForSafeTransactionExecution.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"waitForSafeTransactionExecution.d.ts","names":[],"sources":["../../../src/actions/waitForSafeTransactionExecution.ts"],"mappings":";;;UAUiB;EACf;EACA,aAAa;EACb;EACA;EACA;;;;;;;;;;;iBAYoB,gCACpB,QAAQ,aAEN,SACA,aACA,WACA,iBACA,SAAS,aACR,uCACF,QAAQ"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ChainId, SDKClient } from "@lifi/sdk";
|
|
2
2
|
import { Chain, Client, Hash, ReplacementReturnType, TransactionReceipt } from "viem";
|
|
3
|
-
|
|
4
3
|
//#region src/actions/waitForTransactionReceipt.d.ts
|
|
5
4
|
interface WaitForTransactionReceiptProps {
|
|
6
5
|
client: Client;
|
|
@@ -8,12 +7,7 @@ interface WaitForTransactionReceiptProps {
|
|
|
8
7
|
txHash: Hash;
|
|
9
8
|
onReplaced?: (response: ReplacementReturnType<Chain | undefined>) => void;
|
|
10
9
|
}
|
|
11
|
-
declare function waitForTransactionReceipt(client: SDKClient, {
|
|
12
|
-
client: viemClient,
|
|
13
|
-
chainId,
|
|
14
|
-
txHash,
|
|
15
|
-
onReplaced
|
|
16
|
-
}: WaitForTransactionReceiptProps): Promise<TransactionReceipt | undefined>;
|
|
10
|
+
declare function waitForTransactionReceipt(client: SDKClient, { client: viemClient, chainId, txHash, onReplaced }: WaitForTransactionReceiptProps): Promise<TransactionReceipt | undefined>;
|
|
17
11
|
//#endregion
|
|
18
12
|
export { waitForTransactionReceipt };
|
|
19
13
|
//# sourceMappingURL=waitForTransactionReceipt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waitForTransactionReceipt.d.ts","names":[],"sources":["../../../src/actions/waitForTransactionReceipt.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"waitForTransactionReceipt.d.ts","names":[],"sources":["../../../src/actions/waitForTransactionReceipt.ts"],"mappings":";;;UAiBU;EACR,QAAQ;EACR,SAAS;EACT,QAAQ;EACR,cAAc,UAAU,sBAAsB;;iBAG1B,0BACpB,QAAQ,aAEN,QAAQ,YACR,SACA,QACA,cACC,iCACF,QAAQ"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { SDKClient } from "@lifi/sdk";
|
|
2
2
|
import { Client } from "viem";
|
|
3
|
-
|
|
4
3
|
//#region src/client/publicClient.d.ts
|
|
5
4
|
/**
|
|
6
|
-
* Get an instance of a provider for a specific chain
|
|
7
|
-
* @param client - The SDK client
|
|
8
|
-
* @param chainId - Id of the chain the provider is for
|
|
9
|
-
* @returns The public client for the given chain
|
|
10
|
-
*/
|
|
5
|
+
* Get an instance of a provider for a specific chain
|
|
6
|
+
* @param client - The SDK client
|
|
7
|
+
* @param chainId - Id of the chain the provider is for
|
|
8
|
+
* @returns The public client for the given chain
|
|
9
|
+
*/
|
|
11
10
|
declare const getPublicClient: (client: SDKClient, chainId: number) => Promise<Client>;
|
|
12
11
|
//#endregion
|
|
13
12
|
export { getPublicClient };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publicClient.d.ts","names":[],"sources":["../../../src/client/publicClient.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"publicClient.d.ts","names":[],"sources":["../../../src/client/publicClient.ts"],"mappings":";;;;;;;;;cAgBa,kBACX,QAAQ,WACR,oBACC,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safeClient.d.ts","names":[],"sources":["../../../src/client/safeClient.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"safeClient.d.ts","names":[],"sources":["../../../src/client/safeClient.ts"],"mappings":";;;UAoEiB;EACf,UAAU,SAAS,YAAY,QAAQ;EACvC,iBAAiB,YAAY,SAAS,QAAQ;EAC9C,kBACE,aAAa,SACb;IAAY;IAAoB;QAC7B,QAAQ;;cAGF,gBACX,iBACA,oBACC;KA+BS,aAAa,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/client/types.ts"],"mappings":";UAAiB
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/client/types.ts"],"mappings":";UAAiB;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA,gBAAgB;IAAQ;;;UAGT;EACf;EACA,SAAS"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../types.js";
|
|
2
2
|
import { BaseStepExecutor, ExecuteStepRetryError, ExecuteStepRetryParams, ExecutionAction, LiFiStepExtended, SDKError, StepExecutorBaseContext, StepExecutorOptions, TaskPipeline } from "@lifi/sdk";
|
|
3
3
|
import { Client } from "viem";
|
|
4
|
-
|
|
5
4
|
//#region src/core/EthereumStepExecutor.d.ts
|
|
6
5
|
interface EthereumStepExecutorOptions extends StepExecutorOptions {
|
|
7
6
|
client: Client;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumStepExecutor.d.ts","names":[],"sources":["../../../src/core/EthereumStepExecutor.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthereumStepExecutor.d.ts","names":[],"sources":["../../../src/core/EthereumStepExecutor.ts"],"mappings":";;;;UAmCU,oCAAoC;EAC5C,QAAQ;EACR,eAAe,oBAAoB,QAAQ;EAC3C;;cAGW,6BAA6B;UAChC;UACA;UACA;UACA;EAER,YAAY,SAAS;UAOb;WAOC,cACP,OAAO,OACP,OAAO,kBACP,SAAS,iBACT,cAAc,2BACb,QAAQ,WAAW;EAItB,cACE,MAAM,kBACN,2BACC,QAAQ;WAgCF,gBACP,aAAa,4BACZ,QAAQ;WA0BF,iBACP,SAAS,gCACR"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
|
-
|
|
4
3
|
//#region src/core/tasks/EthereumBatchedSignAndExecuteTask.d.ts
|
|
5
4
|
declare class EthereumBatchedSignAndExecuteTask extends BaseStepExecutionTask {
|
|
6
5
|
run(context: EthereumStepExecutorContext): Promise<TaskResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumBatchedSignAndExecuteTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumBatchedSignAndExecuteTask.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthereumBatchedSignAndExecuteTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumBatchedSignAndExecuteTask.ts"],"mappings":";;;cAWa,0CAA0C;EACrD,IAAU,SAAS,8BAA8B,QAAQ"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
|
-
|
|
4
3
|
//#region src/core/tasks/EthereumBatchedWaitForTransactionTask.d.ts
|
|
5
4
|
declare class EthereumBatchedWaitForTransactionTask extends BaseStepExecutionTask {
|
|
6
5
|
run(context: EthereumStepExecutorContext): Promise<TaskResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumBatchedWaitForTransactionTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumBatchedWaitForTransactionTask.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthereumBatchedWaitForTransactionTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumBatchedWaitForTransactionTask.ts"],"mappings":";;;cAca,8CAA8C;EACzD,IAAU,SAAS,8BAA8B,QAAQ"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
|
-
|
|
4
3
|
//#region src/core/tasks/EthereumCheckAllowanceTask.d.ts
|
|
5
4
|
declare class EthereumCheckAllowanceTask extends BaseStepExecutionTask {
|
|
6
5
|
override shouldRun(context: EthereumStepExecutorContext): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumCheckAllowanceTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumCheckAllowanceTask.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthereumCheckAllowanceTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumCheckAllowanceTask.ts"],"mappings":";;;cAOa,mCAAmC;WAC/B,UACb,SAAS,8BACR;EAIH,IAAU,SAAS,8BAA8B,QAAQ"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { CheckBalanceOptions, CheckBalanceTask } from "@lifi/sdk";
|
|
3
|
-
|
|
4
3
|
//#region src/core/tasks/EthereumCheckBalanceTask.d.ts
|
|
5
4
|
/**
|
|
6
|
-
* Skips the outer-tx gas check for steps where the wallet doesn't fund it:
|
|
7
|
-
* smart-contract wallets (Safe Apps, 4337, 7579, …) where the
|
|
8
|
-
* executor / bundler / paymaster pays, and relayed steps. Source amount
|
|
9
|
-
* and non-included native fees are still verified.
|
|
10
|
-
*
|
|
11
|
-
* Skip-bias is intentional: a wrong skip is caught by the wallet rejecting
|
|
12
|
-
* the tx; a wrong enforce blocks a tx that would have succeeded.
|
|
13
|
-
*/
|
|
5
|
+
* Skips the outer-tx gas check for steps where the wallet doesn't fund it:
|
|
6
|
+
* smart-contract wallets (Safe Apps, 4337, 7579, …) where the
|
|
7
|
+
* executor / bundler / paymaster pays, and relayed steps. Source amount
|
|
8
|
+
* and non-included native fees are still verified.
|
|
9
|
+
*
|
|
10
|
+
* Skip-bias is intentional: a wrong skip is caught by the wallet rejecting
|
|
11
|
+
* the tx; a wrong enforce blocks a tx that would have succeeded.
|
|
12
|
+
*/
|
|
14
13
|
declare class EthereumCheckBalanceTask extends CheckBalanceTask {
|
|
15
14
|
protected override getCheckBalanceOptions(context: EthereumStepExecutorContext): Promise<CheckBalanceOptions>;
|
|
16
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumCheckBalanceTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumCheckBalanceTask.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthereumCheckBalanceTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumCheckBalanceTask.ts"],"mappings":";;;;;;;;;;;;cAgBa,iCAAiC;qBACnB,uBACvB,SAAS,8BACR,QAAQ"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
|
-
|
|
4
3
|
//#region src/core/tasks/EthereumCheckPermitsTask.d.ts
|
|
5
4
|
declare class EthereumCheckPermitsTask extends BaseStepExecutionTask {
|
|
6
5
|
override shouldRun(context: EthereumStepExecutorContext): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumCheckPermitsTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumCheckPermitsTask.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthereumCheckPermitsTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumCheckPermitsTask.ts"],"mappings":";;;cAWa,iCAAiC;WAC7B,UACb,SAAS,8BACR;EAUH,IAAU,SAAS,8BAA8B,QAAQ"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getDomainChainId } from "../../utils/getDomainChainId.js";
|
|
2
|
+
import { assertValidSignature } from "../../utils/isValidSignature.js";
|
|
2
3
|
import { BaseStepExecutionTask } from "@lifi/sdk";
|
|
3
4
|
import { signTypedData } from "viem/actions";
|
|
4
5
|
import { getAction } from "viem/utils";
|
|
@@ -30,6 +31,7 @@ var EthereumCheckPermitsTask = class extends BaseStepExecutionTask {
|
|
|
30
31
|
primaryType: typedData.primaryType,
|
|
31
32
|
message: typedData.message
|
|
32
33
|
});
|
|
34
|
+
assertValidSignature(signature);
|
|
33
35
|
const signedPermit = {
|
|
34
36
|
...typedData,
|
|
35
37
|
signature
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumCheckPermitsTask.js","names":[],"sources":["../../../../src/core/tasks/EthereumCheckPermitsTask.ts"],"sourcesContent":["import {\n BaseStepExecutionTask,\n type SignedTypedData,\n type TaskResult,\n} from '@lifi/sdk'\nimport { signTypedData } from 'viem/actions'\nimport { getAction } from 'viem/utils'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { getDomainChainId } from '../../utils/getDomainChainId.js'\n\nexport class EthereumCheckPermitsTask extends BaseStepExecutionTask {\n override async shouldRun(\n context: EthereumStepExecutorContext\n ): Promise<boolean> {\n const { step, disableMessageSigning } = context\n\n const permitTypedData = step.typedData?.filter(\n (typedData) => typedData.primaryType === 'Permit'\n )\n\n return !!permitTypedData?.length && !disableMessageSigning\n }\n\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n step,\n statusManager,\n allowUserInteraction,\n checkClient,\n signedTypedData: currentSignedTypedData,\n } = context\n\n const action = statusManager.initializeAction({\n step,\n type: 'PERMIT',\n chainId: step.action.fromChainId,\n status: 'STARTED',\n })\n\n // First, try to sign all permits in step.typedData\n const permitTypedData =\n step.typedData?.filter(\n (typedData) => typedData.primaryType === 'Permit'\n ) ?? []\n\n const signedTypedData = [...currentSignedTypedData]\n for (const typedData of permitTypedData) {\n statusManager.updateAction(step, action.type, 'ACTION_REQUIRED')\n\n if (!allowUserInteraction) {\n return { status: 'PAUSED' }\n }\n\n const typedDataChainId =\n getDomainChainId(typedData.domain) || step.action.fromChainId\n\n // Switch to the permit's chain if needed\n const permitClient = await checkClient(step, typedDataChainId)\n if (!permitClient) {\n return { status: 'PAUSED' }\n }\n\n const signature = await getAction(\n permitClient,\n signTypedData,\n 'signTypedData'\n )({\n account: permitClient.account!,\n domain: typedData.domain,\n types: typedData.types,\n primaryType: typedData.primaryType,\n message: typedData.message,\n })\n const signedPermit: SignedTypedData = {\n ...typedData,\n signature,\n }\n signedTypedData.push(signedPermit)\n }\n\n // Check if there's a signed permit for the source transaction chain\n const matchingPermit = signedTypedData.find(\n (signedTypedData) =>\n getDomainChainId(signedTypedData.domain) === step.action.fromChainId\n )\n\n statusManager.updateAction(step, action.type, 'DONE')\n\n return {\n status: 'COMPLETED',\n context: { signedTypedData, hasMatchingPermit: !!matchingPermit },\n }\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthereumCheckPermitsTask.js","names":[],"sources":["../../../../src/core/tasks/EthereumCheckPermitsTask.ts"],"sourcesContent":["import {\n BaseStepExecutionTask,\n type SignedTypedData,\n type TaskResult,\n} from '@lifi/sdk'\nimport { signTypedData } from 'viem/actions'\nimport { getAction } from 'viem/utils'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { getDomainChainId } from '../../utils/getDomainChainId.js'\nimport { assertValidSignature } from '../../utils/isValidSignature.js'\n\nexport class EthereumCheckPermitsTask extends BaseStepExecutionTask {\n override async shouldRun(\n context: EthereumStepExecutorContext\n ): Promise<boolean> {\n const { step, disableMessageSigning } = context\n\n const permitTypedData = step.typedData?.filter(\n (typedData) => typedData.primaryType === 'Permit'\n )\n\n return !!permitTypedData?.length && !disableMessageSigning\n }\n\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n step,\n statusManager,\n allowUserInteraction,\n checkClient,\n signedTypedData: currentSignedTypedData,\n } = context\n\n const action = statusManager.initializeAction({\n step,\n type: 'PERMIT',\n chainId: step.action.fromChainId,\n status: 'STARTED',\n })\n\n // First, try to sign all permits in step.typedData\n const permitTypedData =\n step.typedData?.filter(\n (typedData) => typedData.primaryType === 'Permit'\n ) ?? []\n\n const signedTypedData = [...currentSignedTypedData]\n for (const typedData of permitTypedData) {\n statusManager.updateAction(step, action.type, 'ACTION_REQUIRED')\n\n if (!allowUserInteraction) {\n return { status: 'PAUSED' }\n }\n\n const typedDataChainId =\n getDomainChainId(typedData.domain) || step.action.fromChainId\n\n // Switch to the permit's chain if needed\n const permitClient = await checkClient(step, typedDataChainId)\n if (!permitClient) {\n return { status: 'PAUSED' }\n }\n\n const signature = await getAction(\n permitClient,\n signTypedData,\n 'signTypedData'\n )({\n account: permitClient.account!,\n domain: typedData.domain,\n types: typedData.types,\n primaryType: typedData.primaryType,\n message: typedData.message,\n })\n assertValidSignature(signature)\n const signedPermit: SignedTypedData = {\n ...typedData,\n signature,\n }\n signedTypedData.push(signedPermit)\n }\n\n // Check if there's a signed permit for the source transaction chain\n const matchingPermit = signedTypedData.find(\n (signedTypedData) =>\n getDomainChainId(signedTypedData.domain) === step.action.fromChainId\n )\n\n statusManager.updateAction(step, action.type, 'DONE')\n\n return {\n status: 'COMPLETED',\n context: { signedTypedData, hasMatchingPermit: !!matchingPermit },\n }\n }\n}\n"],"mappings":";;;;;;AAWA,IAAa,2BAAb,cAA8C,sBAAsB;CAClE,MAAe,UACb,SACkB;EAClB,MAAM,EAAE,MAAM,0BAA0B;EAMxC,OAAO,CAAC,EAJgB,KAAK,WAAW,QACrC,cAAc,UAAU,gBAAgB,QAC3C,EAAA,EAE0B,UAAU,CAAC;CACvC;CAEA,MAAM,IAAI,SAA2D;EACnE,MAAM,EACJ,MACA,eACA,sBACA,aACA,iBAAiB,2BACf;EAEJ,MAAM,SAAS,cAAc,iBAAiB;GAC5C;GACA,MAAM;GACN,SAAS,KAAK,OAAO;GACrB,QAAQ;EACV,CAAC;EAGD,MAAM,kBACJ,KAAK,WAAW,QACb,cAAc,UAAU,gBAAgB,QAC3C,KAAK,CAAC;EAER,MAAM,kBAAkB,CAAC,GAAG,sBAAsB;EAClD,KAAK,MAAM,aAAa,iBAAiB;GACvC,cAAc,aAAa,MAAM,OAAO,MAAM,iBAAiB;GAE/D,IAAI,CAAC,sBACH,OAAO,EAAE,QAAQ,SAAS;GAO5B,MAAM,eAAe,MAAM,YAAY,MAHrC,iBAAiB,UAAU,MAAM,KAAK,KAAK,OAAO,WAGS;GAC7D,IAAI,CAAC,cACH,OAAO,EAAE,QAAQ,SAAS;GAG5B,MAAM,YAAY,MAAM,UACtB,cACA,eACA,eACF,CAAC,CAAC;IACA,SAAS,aAAa;IACtB,QAAQ,UAAU;IAClB,OAAO,UAAU;IACjB,aAAa,UAAU;IACvB,SAAS,UAAU;GACrB,CAAC;GACD,qBAAqB,SAAS;GAC9B,MAAM,eAAgC;IACpC,GAAG;IACH;GACF;GACA,gBAAgB,KAAK,YAAY;EACnC;EAGA,MAAM,iBAAiB,gBAAgB,MACpC,oBACC,iBAAiB,gBAAgB,MAAM,MAAM,KAAK,OAAO,WAC7D;EAEA,cAAc,aAAa,MAAM,OAAO,MAAM,MAAM;EAEpD,OAAO;GACL,QAAQ;GACR,SAAS;IAAE;IAAiB,mBAAmB,CAAC,CAAC;GAAe;EAClE;CACF;AACF"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
|
-
|
|
4
3
|
//#region src/core/tasks/EthereumNativePermitTask.d.ts
|
|
5
4
|
declare class EthereumNativePermitTask extends BaseStepExecutionTask {
|
|
6
5
|
override shouldRun(context: EthereumStepExecutorContext): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumNativePermitTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumNativePermitTask.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthereumNativePermitTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumNativePermitTask.ts"],"mappings":";;;cAea,iCAAiC;WAC7B,UACb,SAAS,8BACR;EAwBH,IAAU,SAAS,8BAA8B,QAAQ"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getActionWithFallback } from "../../utils/getActionWithFallback.js";
|
|
2
2
|
import { getEthereumExecutionStrategy } from "./helpers/getEthereumExecutionStrategy.js";
|
|
3
|
+
import { isValidSignature } from "../../utils/isValidSignature.js";
|
|
3
4
|
import { getNativePermit } from "../../permits/getNativePermit.js";
|
|
4
5
|
import { isNativePermitValid } from "../../permits/isNativePermitValid.js";
|
|
5
6
|
import { BaseStepExecutionTask } from "@lifi/sdk";
|
|
@@ -47,6 +48,10 @@ var EthereumNativePermitTask = class extends BaseStepExecutionTask {
|
|
|
47
48
|
primaryType: nativePermitData.primaryType,
|
|
48
49
|
message: nativePermitData.message
|
|
49
50
|
});
|
|
51
|
+
if (!isValidSignature(signature)) {
|
|
52
|
+
statusManager.updateAction(step, action.type, "DONE");
|
|
53
|
+
return { status: "COMPLETED" };
|
|
54
|
+
}
|
|
50
55
|
const signedPermit = {
|
|
51
56
|
...nativePermitData,
|
|
52
57
|
signature
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumNativePermitTask.js","names":[],"sources":["../../../../src/core/tasks/EthereumNativePermitTask.ts"],"sourcesContent":["import {\n BaseStepExecutionTask,\n type SignedTypedData,\n type TaskResult,\n} from '@lifi/sdk'\nimport type { Address } from 'viem'\nimport { signTypedData } from 'viem/actions'\nimport { getAction } from 'viem/utils'\nimport { getNativePermit } from '../../permits/getNativePermit.js'\nimport { isNativePermitValid } from '../../permits/isNativePermitValid.js'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { getActionWithFallback } from '../../utils/getActionWithFallback.js'\nimport { getEthereumExecutionStrategy } from './helpers/getEthereumExecutionStrategy.js'\n\nexport class EthereumNativePermitTask extends BaseStepExecutionTask {\n override async shouldRun(\n context: EthereumStepExecutorContext\n ): Promise<boolean> {\n const {\n step,\n fromChain,\n hasMatchingPermit,\n hasSufficientAllowance,\n disableMessageSigning,\n } = context\n\n if (hasMatchingPermit || hasSufficientAllowance) {\n return false\n }\n\n const executionStrategy = await getEthereumExecutionStrategy(context)\n const batchingSupported = executionStrategy === 'batched'\n // Check if proxy contract is available and message signing is not disabled, also not available for atomic batch\n const isNativePermitAvailable =\n !!fromChain.permit2Proxy &&\n !batchingSupported &&\n !disableMessageSigning &&\n !step.estimate.skipPermit\n return isNativePermitAvailable\n }\n\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n step,\n client,\n fromChain,\n statusManager,\n allowUserInteraction,\n checkClient,\n signedTypedData: currentSignedTypedData,\n } = context\n\n const action = statusManager.initializeAction({\n step,\n type: 'NATIVE_PERMIT',\n chainId: step.action.fromChainId,\n status: 'STARTED',\n })\n\n const updatedClient = await checkClient(step)\n if (!updatedClient) {\n return { status: 'PAUSED' }\n }\n\n const fromAmount = BigInt(step.action.fromAmount)\n\n const nativePermitData = await getActionWithFallback(\n client,\n updatedClient,\n getNativePermit,\n 'getNativePermit',\n {\n client,\n viemClient: updatedClient,\n chainId: fromChain.id,\n tokenAddress: step.action.fromToken.address as Address,\n spenderAddress: fromChain.permit2Proxy as Address,\n amount: fromAmount,\n }\n )\n\n if (!nativePermitData) {\n statusManager.updateAction(step, action.type, 'DONE')\n return { status: 'COMPLETED' }\n }\n\n const signedTypedData = [...currentSignedTypedData]\n\n // Check if we already have a valid permit for this chain and requirements\n const signedTypedDataForChain = signedTypedData.find((signedTypedData) =>\n isNativePermitValid(signedTypedData, nativePermitData)\n )\n\n if (!signedTypedDataForChain) {\n statusManager.updateAction(step, action.type, 'ACTION_REQUIRED')\n\n if (!allowUserInteraction) {\n return { status: 'PAUSED' }\n }\n\n // Sign the permit\n const signature = await getAction(\n updatedClient,\n signTypedData,\n 'signTypedData'\n )({\n account: updatedClient.account!,\n domain: nativePermitData.domain,\n types: nativePermitData.types,\n primaryType: nativePermitData.primaryType,\n message: nativePermitData.message,\n })\n\n // Add the new permit to the signed permits array\n const signedPermit: SignedTypedData = {\n ...nativePermitData,\n signature,\n }\n signedTypedData.push(signedPermit)\n }\n\n statusManager.updateAction(step, action.type, 'DONE')\n\n return {\n status: 'COMPLETED',\n context: { signedTypedData, hasMatchingPermit: true },\n }\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthereumNativePermitTask.js","names":[],"sources":["../../../../src/core/tasks/EthereumNativePermitTask.ts"],"sourcesContent":["import {\n BaseStepExecutionTask,\n type SignedTypedData,\n type TaskResult,\n} from '@lifi/sdk'\nimport type { Address } from 'viem'\nimport { signTypedData } from 'viem/actions'\nimport { getAction } from 'viem/utils'\nimport { getNativePermit } from '../../permits/getNativePermit.js'\nimport { isNativePermitValid } from '../../permits/isNativePermitValid.js'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { getActionWithFallback } from '../../utils/getActionWithFallback.js'\nimport { isValidSignature } from '../../utils/isValidSignature.js'\nimport { getEthereumExecutionStrategy } from './helpers/getEthereumExecutionStrategy.js'\n\nexport class EthereumNativePermitTask extends BaseStepExecutionTask {\n override async shouldRun(\n context: EthereumStepExecutorContext\n ): Promise<boolean> {\n const {\n step,\n fromChain,\n hasMatchingPermit,\n hasSufficientAllowance,\n disableMessageSigning,\n } = context\n\n if (hasMatchingPermit || hasSufficientAllowance) {\n return false\n }\n\n const executionStrategy = await getEthereumExecutionStrategy(context)\n const batchingSupported = executionStrategy === 'batched'\n // Check if proxy contract is available and message signing is not disabled, also not available for atomic batch\n const isNativePermitAvailable =\n !!fromChain.permit2Proxy &&\n !batchingSupported &&\n !disableMessageSigning &&\n !step.estimate.skipPermit\n return isNativePermitAvailable\n }\n\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n step,\n client,\n fromChain,\n statusManager,\n allowUserInteraction,\n checkClient,\n signedTypedData: currentSignedTypedData,\n } = context\n\n const action = statusManager.initializeAction({\n step,\n type: 'NATIVE_PERMIT',\n chainId: step.action.fromChainId,\n status: 'STARTED',\n })\n\n const updatedClient = await checkClient(step)\n if (!updatedClient) {\n return { status: 'PAUSED' }\n }\n\n const fromAmount = BigInt(step.action.fromAmount)\n\n const nativePermitData = await getActionWithFallback(\n client,\n updatedClient,\n getNativePermit,\n 'getNativePermit',\n {\n client,\n viemClient: updatedClient,\n chainId: fromChain.id,\n tokenAddress: step.action.fromToken.address as Address,\n spenderAddress: fromChain.permit2Proxy as Address,\n amount: fromAmount,\n }\n )\n\n if (!nativePermitData) {\n statusManager.updateAction(step, action.type, 'DONE')\n return { status: 'COMPLETED' }\n }\n\n const signedTypedData = [...currentSignedTypedData]\n\n // Check if we already have a valid permit for this chain and requirements\n const signedTypedDataForChain = signedTypedData.find((signedTypedData) =>\n isNativePermitValid(signedTypedData, nativePermitData)\n )\n\n if (!signedTypedDataForChain) {\n statusManager.updateAction(step, action.type, 'ACTION_REQUIRED')\n\n if (!allowUserInteraction) {\n return { status: 'PAUSED' }\n }\n\n // Sign the permit\n const signature = await getAction(\n updatedClient,\n signTypedData,\n 'signTypedData'\n )({\n account: updatedClient.account!,\n domain: nativePermitData.domain,\n types: nativePermitData.types,\n primaryType: nativePermitData.primaryType,\n message: nativePermitData.message,\n })\n\n // Some wallets resolve signTypedData with a nullish or empty value\n // instead of rejecting — skip the permit and fall back to the\n // Permit2/standard approval flow\n if (!isValidSignature(signature)) {\n statusManager.updateAction(step, action.type, 'DONE')\n return { status: 'COMPLETED' }\n }\n\n // Add the new permit to the signed permits array\n const signedPermit: SignedTypedData = {\n ...nativePermitData,\n signature,\n }\n signedTypedData.push(signedPermit)\n }\n\n statusManager.updateAction(step, action.type, 'DONE')\n\n return {\n status: 'COMPLETED',\n context: { signedTypedData, hasMatchingPermit: true },\n }\n }\n}\n"],"mappings":";;;;;;;;;AAeA,IAAa,2BAAb,cAA8C,sBAAsB;CAClE,MAAe,UACb,SACkB;EAClB,MAAM,EACJ,MACA,WACA,mBACA,wBACA,0BACE;EAEJ,IAAI,qBAAqB,wBACvB,OAAO;EAIT,MAAM,oBAAoB,MADM,6BAA6B,OAAO,MACpB;EAOhD,OAJE,CAAC,CAAC,UAAU,gBACZ,CAAC,qBACD,CAAC,yBACD,CAAC,KAAK,SAAS;CAEnB;CAEA,MAAM,IAAI,SAA2D;EACnE,MAAM,EACJ,MACA,QACA,WACA,eACA,sBACA,aACA,iBAAiB,2BACf;EAEJ,MAAM,SAAS,cAAc,iBAAiB;GAC5C;GACA,MAAM;GACN,SAAS,KAAK,OAAO;GACrB,QAAQ;EACV,CAAC;EAED,MAAM,gBAAgB,MAAM,YAAY,IAAI;EAC5C,IAAI,CAAC,eACH,OAAO,EAAE,QAAQ,SAAS;EAG5B,MAAM,aAAa,OAAO,KAAK,OAAO,UAAU;EAEhD,MAAM,mBAAmB,MAAM,sBAC7B,QACA,eACA,iBACA,mBACA;GACE;GACA,YAAY;GACZ,SAAS,UAAU;GACnB,cAAc,KAAK,OAAO,UAAU;GACpC,gBAAgB,UAAU;GAC1B,QAAQ;EACV,CACF;EAEA,IAAI,CAAC,kBAAkB;GACrB,cAAc,aAAa,MAAM,OAAO,MAAM,MAAM;GACpD,OAAO,EAAE,QAAQ,YAAY;EAC/B;EAEA,MAAM,kBAAkB,CAAC,GAAG,sBAAsB;EAOlD,IAAI,CAJ4B,gBAAgB,MAAM,oBACpD,oBAAoB,iBAAiB,gBAAgB,CAG5B,GAAG;GAC5B,cAAc,aAAa,MAAM,OAAO,MAAM,iBAAiB;GAE/D,IAAI,CAAC,sBACH,OAAO,EAAE,QAAQ,SAAS;GAI5B,MAAM,YAAY,MAAM,UACtB,eACA,eACA,eACF,CAAC,CAAC;IACA,SAAS,cAAc;IACvB,QAAQ,iBAAiB;IACzB,OAAO,iBAAiB;IACxB,aAAa,iBAAiB;IAC9B,SAAS,iBAAiB;GAC5B,CAAC;GAKD,IAAI,CAAC,iBAAiB,SAAS,GAAG;IAChC,cAAc,aAAa,MAAM,OAAO,MAAM,MAAM;IACpD,OAAO,EAAE,QAAQ,YAAY;GAC/B;GAGA,MAAM,eAAgC;IACpC,GAAG;IACH;GACF;GACA,gBAAgB,KAAK,YAAY;EACnC;EAEA,cAAc,aAAa,MAAM,OAAO,MAAM,MAAM;EAEpD,OAAO;GACL,QAAQ;GACR,SAAS;IAAE;IAAiB,mBAAmB;GAAK;EACtD;CACF;AACF"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
|
-
|
|
4
3
|
//#region src/core/tasks/EthereumPrepareTransactionTask.d.ts
|
|
5
4
|
declare class EthereumPrepareTransactionTask extends BaseStepExecutionTask {
|
|
6
5
|
run(context: EthereumStepExecutorContext): Promise<TaskResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumPrepareTransactionTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumPrepareTransactionTask.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthereumPrepareTransactionTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumPrepareTransactionTask.ts"],"mappings":";;;cAaa,uCAAuC;EAClD,IAAU,SAAS,8BAA8B,QAAQ"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EthereumStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
|
-
|
|
4
3
|
//#region src/core/tasks/EthereumRelayedSignAndExecuteTask.d.ts
|
|
5
4
|
declare class EthereumRelayedSignAndExecuteTask extends BaseStepExecutionTask {
|
|
6
5
|
run(context: EthereumStepExecutorContext): Promise<TaskResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumRelayedSignAndExecuteTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumRelayedSignAndExecuteTask.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthereumRelayedSignAndExecuteTask.d.ts","names":[],"sources":["../../../../src/core/tasks/EthereumRelayedSignAndExecuteTask.ts"],"mappings":";;;cAiBa,0CAA0C;EACrD,IAAU,SAAS,8BAA8B,QAAQ"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getDomainChainId } from "../../utils/getDomainChainId.js";
|
|
2
|
+
import { assertValidSignature } from "../../utils/isValidSignature.js";
|
|
2
3
|
import { isNativePermitValid } from "../../permits/isNativePermitValid.js";
|
|
3
4
|
import { isHyperliquidAgentStep } from "../../hyperliquid/isHyperliquidAgentStep.js";
|
|
4
5
|
import { signHyperliquidTypedData } from "./helpers/signHyperliquidTypedData.js";
|
|
@@ -30,6 +31,7 @@ var EthereumRelayedSignAndExecuteTask = class extends BaseStepExecutionTask {
|
|
|
30
31
|
types: typedData.types,
|
|
31
32
|
message: typedData.message
|
|
32
33
|
});
|
|
34
|
+
assertValidSignature(signature);
|
|
33
35
|
signedTypedData.push({
|
|
34
36
|
...typedData,
|
|
35
37
|
signature
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumRelayedSignAndExecuteTask.js","names":[],"sources":["../../../../src/core/tasks/EthereumRelayedSignAndExecuteTask.ts"],"sourcesContent":["import {\n BaseStepExecutionTask,\n LiFiErrorCode,\n relayTransaction,\n type TaskResult,\n TransactionError,\n} from '@lifi/sdk'\nimport type { Hash } from 'viem'\nimport { signTypedData } from 'viem/actions'\nimport { getAction } from 'viem/utils'\nimport { isHyperliquidAgentStep } from '../../hyperliquid/isHyperliquidAgentStep.js'\nimport { isNativePermitValid } from '../../permits/isNativePermitValid.js'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { getDomainChainId } from '../../utils/getDomainChainId.js'\nimport { signHyperliquidTypedData } from './helpers/signHyperliquidTypedData.js'\n\nexport class EthereumRelayedSignAndExecuteTask extends BaseStepExecutionTask {\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n step,\n fromChain,\n client,\n statusManager,\n allowUserInteraction,\n checkClient,\n isBridgeExecution,\n signedTypedData: currentSignedTypedData,\n } = context\n\n const signedTypedData = [...currentSignedTypedData]\n\n const action = statusManager.findAction(\n step,\n isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'\n )\n\n if (!action) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Action not found.'\n )\n }\n\n const intentTypedData = step.typedData?.filter(\n (typedData) =>\n !signedTypedData.some((signedPermit) =>\n isNativePermitValid(signedPermit, typedData)\n )\n )\n if (!intentTypedData?.length) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Typed data for transfer is not found.'\n )\n }\n\n statusManager.updateAction(step, action.type, 'MESSAGE_REQUIRED')\n\n if (isHyperliquidAgentStep(step)) {\n const signedResults = await signHyperliquidTypedData(\n context,\n intentTypedData\n )\n\n if (!signedResults) {\n return { status: 'PAUSED' }\n }\n\n signedTypedData.push(...signedResults)\n } else {\n for (const typedData of intentTypedData) {\n if (!allowUserInteraction) {\n return { status: 'PAUSED' }\n }\n\n const typedDataChainId =\n getDomainChainId(typedData.domain) || fromChain.id\n\n // Switch to the typed data's chain if needed\n const updatedClient = await checkClient(step, typedDataChainId)\n if (!updatedClient) {\n return { status: 'PAUSED' }\n }\n\n const signature = await getAction(\n updatedClient,\n signTypedData,\n 'signTypedData'\n )({\n account: updatedClient.account!,\n primaryType: typedData.primaryType,\n domain: typedData.domain,\n types: typedData.types,\n message: typedData.message,\n })\n\n signedTypedData.push({\n ...typedData,\n signature: signature,\n })\n }\n }\n\n statusManager.updateAction(step, action.type, 'PENDING')\n\n const { execution, ...stepBase } = step\n const relayedTransaction = await relayTransaction(client, {\n ...stepBase,\n typedData: signedTypedData,\n })\n\n statusManager.updateAction(step, action.type, 'PENDING', {\n taskId: relayedTransaction.taskId as Hash,\n txType: 'relayed',\n txLink: relayedTransaction.txLink,\n signedAt: Date.now(),\n })\n\n return { status: 'COMPLETED', context: { signedTypedData } }\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthereumRelayedSignAndExecuteTask.js","names":[],"sources":["../../../../src/core/tasks/EthereumRelayedSignAndExecuteTask.ts"],"sourcesContent":["import {\n BaseStepExecutionTask,\n LiFiErrorCode,\n relayTransaction,\n type TaskResult,\n TransactionError,\n} from '@lifi/sdk'\nimport type { Hash } from 'viem'\nimport { signTypedData } from 'viem/actions'\nimport { getAction } from 'viem/utils'\nimport { isHyperliquidAgentStep } from '../../hyperliquid/isHyperliquidAgentStep.js'\nimport { isNativePermitValid } from '../../permits/isNativePermitValid.js'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { getDomainChainId } from '../../utils/getDomainChainId.js'\nimport { assertValidSignature } from '../../utils/isValidSignature.js'\nimport { signHyperliquidTypedData } from './helpers/signHyperliquidTypedData.js'\n\nexport class EthereumRelayedSignAndExecuteTask extends BaseStepExecutionTask {\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n step,\n fromChain,\n client,\n statusManager,\n allowUserInteraction,\n checkClient,\n isBridgeExecution,\n signedTypedData: currentSignedTypedData,\n } = context\n\n const signedTypedData = [...currentSignedTypedData]\n\n const action = statusManager.findAction(\n step,\n isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'\n )\n\n if (!action) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Action not found.'\n )\n }\n\n const intentTypedData = step.typedData?.filter(\n (typedData) =>\n !signedTypedData.some((signedPermit) =>\n isNativePermitValid(signedPermit, typedData)\n )\n )\n if (!intentTypedData?.length) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Typed data for transfer is not found.'\n )\n }\n\n statusManager.updateAction(step, action.type, 'MESSAGE_REQUIRED')\n\n if (isHyperliquidAgentStep(step)) {\n const signedResults = await signHyperliquidTypedData(\n context,\n intentTypedData\n )\n\n if (!signedResults) {\n return { status: 'PAUSED' }\n }\n\n signedTypedData.push(...signedResults)\n } else {\n for (const typedData of intentTypedData) {\n if (!allowUserInteraction) {\n return { status: 'PAUSED' }\n }\n\n const typedDataChainId =\n getDomainChainId(typedData.domain) || fromChain.id\n\n // Switch to the typed data's chain if needed\n const updatedClient = await checkClient(step, typedDataChainId)\n if (!updatedClient) {\n return { status: 'PAUSED' }\n }\n\n const signature = await getAction(\n updatedClient,\n signTypedData,\n 'signTypedData'\n )({\n account: updatedClient.account!,\n primaryType: typedData.primaryType,\n domain: typedData.domain,\n types: typedData.types,\n message: typedData.message,\n })\n\n assertValidSignature(signature)\n\n signedTypedData.push({\n ...typedData,\n signature: signature,\n })\n }\n }\n\n statusManager.updateAction(step, action.type, 'PENDING')\n\n const { execution, ...stepBase } = step\n const relayedTransaction = await relayTransaction(client, {\n ...stepBase,\n typedData: signedTypedData,\n })\n\n statusManager.updateAction(step, action.type, 'PENDING', {\n taskId: relayedTransaction.taskId as Hash,\n txType: 'relayed',\n txLink: relayedTransaction.txLink,\n signedAt: Date.now(),\n })\n\n return { status: 'COMPLETED', context: { signedTypedData } }\n }\n}\n"],"mappings":";;;;;;;;;AAiBA,IAAa,oCAAb,cAAuD,sBAAsB;CAC3E,MAAM,IAAI,SAA2D;EACnE,MAAM,EACJ,MACA,WACA,QACA,eACA,sBACA,aACA,mBACA,iBAAiB,2BACf;EAEJ,MAAM,kBAAkB,CAAC,GAAG,sBAAsB;EAElD,MAAM,SAAS,cAAc,WAC3B,MACA,oBAAoB,gBAAgB,MACtC;EAEA,IAAI,CAAC,QACH,MAAM,IAAI,iBACR,cAAc,uBACd,kDACF;EAGF,MAAM,kBAAkB,KAAK,WAAW,QACrC,cACC,CAAC,gBAAgB,MAAM,iBACrB,oBAAoB,cAAc,SAAS,CAC7C,CACJ;EACA,IAAI,CAAC,iBAAiB,QACpB,MAAM,IAAI,iBACR,cAAc,uBACd,sEACF;EAGF,cAAc,aAAa,MAAM,OAAO,MAAM,kBAAkB;EAEhE,IAAI,uBAAuB,IAAI,GAAG;GAChC,MAAM,gBAAgB,MAAM,yBAC1B,SACA,eACF;GAEA,IAAI,CAAC,eACH,OAAO,EAAE,QAAQ,SAAS;GAG5B,gBAAgB,KAAK,GAAG,aAAa;EACvC,OACE,KAAK,MAAM,aAAa,iBAAiB;GACvC,IAAI,CAAC,sBACH,OAAO,EAAE,QAAQ,SAAS;GAO5B,MAAM,gBAAgB,MAAM,YAAY,MAHtC,iBAAiB,UAAU,MAAM,KAAK,UAAU,EAGY;GAC9D,IAAI,CAAC,eACH,OAAO,EAAE,QAAQ,SAAS;GAG5B,MAAM,YAAY,MAAM,UACtB,eACA,eACA,eACF,CAAC,CAAC;IACA,SAAS,cAAc;IACvB,aAAa,UAAU;IACvB,QAAQ,UAAU;IAClB,OAAO,UAAU;IACjB,SAAS,UAAU;GACrB,CAAC;GAED,qBAAqB,SAAS;GAE9B,gBAAgB,KAAK;IACnB,GAAG;IACQ;GACb,CAAC;EACH;EAGF,cAAc,aAAa,MAAM,OAAO,MAAM,SAAS;EAEvD,MAAM,EAAE,WAAW,GAAG,aAAa;EACnC,MAAM,qBAAqB,MAAM,iBAAiB,QAAQ;GACxD,GAAG;GACH,WAAW;EACb,CAAC;EAED,cAAc,aAAa,MAAM,OAAO,MAAM,WAAW;GACvD,QAAQ,mBAAmB;GAC3B,QAAQ;GACR,QAAQ,mBAAmB;GAC3B,UAAU,KAAK,IAAI;EACrB,CAAC;EAED,OAAO;GAAE,QAAQ;GAAa,SAAS,EAAE,gBAAgB;EAAE;CAC7D;AACF"}
|