@lifi/sdk 4.12.0 → 4.13.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 +40 -0
- package/dist/cjs/actions/getChains.d.ts +1 -4
- package/dist/cjs/actions/getChains.js +1 -2
- package/dist/cjs/actions/getConnections.d.ts +1 -4
- package/dist/cjs/actions/getConnections.js +1 -2
- package/dist/cjs/actions/getContractCallsQuote.d.ts +1 -4
- package/dist/cjs/actions/getContractCallsQuote.js +2 -3
- package/dist/cjs/actions/getGasRecommendation.d.ts +1 -4
- package/dist/cjs/actions/getGasRecommendation.js +2 -3
- package/dist/cjs/actions/getNameServiceAddress.d.ts +1 -4
- package/dist/cjs/actions/getNameServiceAddress.js +1 -2
- package/dist/cjs/actions/getQuote.d.ts +2 -5
- package/dist/cjs/actions/getQuote.js +2 -3
- package/dist/cjs/actions/getRelayedTransactionStatus.d.ts +1 -4
- package/dist/cjs/actions/getRelayedTransactionStatus.js +3 -4
- package/dist/cjs/actions/getRelayerQuote.d.ts +16 -11
- package/dist/cjs/actions/getRelayerQuote.js +18 -35
- package/dist/cjs/actions/getRelayerQuote.js.map +1 -1
- package/dist/cjs/actions/getRoutes.d.ts +2 -5
- package/dist/cjs/actions/getRoutes.js +3 -4
- package/dist/cjs/actions/getStatus.d.ts +2 -5
- package/dist/cjs/actions/getStatus.js +2 -3
- package/dist/cjs/actions/getStepTransaction.d.ts +2 -5
- package/dist/cjs/actions/getStepTransaction.js +2 -3
- package/dist/cjs/actions/getToken.d.ts +1 -4
- package/dist/cjs/actions/getToken.js +2 -3
- package/dist/cjs/actions/getTokenBalance.d.ts +1 -4
- package/dist/cjs/actions/getTokenBalance.js +1 -2
- package/dist/cjs/actions/getTokenBalances.d.ts +1 -4
- package/dist/cjs/actions/getTokenBalances.js +1 -2
- package/dist/cjs/actions/getTokenBalancesByChain.d.ts +1 -4
- package/dist/cjs/actions/getTokenBalancesByChain.js +1 -2
- package/dist/cjs/actions/getTokens.d.ts +1 -4
- package/dist/cjs/actions/getTokens.js +1 -2
- package/dist/cjs/actions/getTools.d.ts +1 -4
- package/dist/cjs/actions/getTools.js +1 -2
- package/dist/cjs/actions/getTransactionHistory.d.ts +1 -4
- package/dist/cjs/actions/getTransactionHistory.js +1 -2
- package/dist/cjs/actions/index.d.ts +4 -5
- package/dist/cjs/actions/index.js +4 -5
- package/dist/cjs/actions/index.js.map +1 -1
- package/dist/cjs/actions/patchContractCalls.d.ts +1 -4
- package/dist/cjs/actions/patchContractCalls.js +1 -2
- package/dist/cjs/actions/relayTransaction.d.ts +1 -4
- package/dist/cjs/actions/relayTransaction.js +3 -5
- package/dist/cjs/actions/relayTransaction.js.map +1 -1
- package/dist/cjs/client/createClient.d.ts +1 -4
- package/dist/cjs/client/createClient.js +2 -3
- package/dist/cjs/client/createClient.js.map +1 -1
- package/dist/cjs/client/findProvider.d.ts +1 -4
- package/dist/cjs/client/findProvider.js +1 -2
- package/dist/cjs/client/getClientStorage.d.ts +1 -4
- package/dist/cjs/client/getClientStorage.js +1 -2
- package/dist/cjs/core/BaseStepExecutionTask.d.ts +1 -4
- package/dist/cjs/core/BaseStepExecutionTask.js +1 -2
- package/dist/cjs/core/BaseStepExecutor.d.ts +4 -7
- package/dist/cjs/core/BaseStepExecutor.js +3 -4
- package/dist/cjs/core/BaseStepExecutor.js.map +1 -1
- package/dist/cjs/core/StatusManager.d.ts +1 -3
- package/dist/cjs/core/StatusManager.js +1 -2
- package/dist/cjs/core/StatusManager.js.map +1 -1
- package/dist/cjs/core/TaskPipeline.d.ts +1 -4
- package/dist/cjs/core/TaskPipeline.js +1 -2
- package/dist/cjs/core/TaskPipeline.js.map +1 -1
- package/dist/cjs/core/actionMessages.d.ts +1 -4
- package/dist/cjs/core/actionMessages.js +1 -2
- package/dist/cjs/core/execution.d.ts +1 -4
- package/dist/cjs/core/execution.js +1 -2
- package/dist/cjs/core/execution.js.map +1 -1
- package/dist/cjs/core/executionState.d.ts +1 -3
- package/dist/cjs/core/executionState.js +1 -2
- package/dist/cjs/core/prepareRestart.d.ts +1 -4
- package/dist/cjs/core/prepareRestart.js +1 -2
- package/dist/cjs/core/storage.d.ts +1 -4
- package/dist/cjs/core/storage.js +1 -2
- package/dist/cjs/core/storage.js.map +1 -1
- package/dist/cjs/core/tasks/CheckBalanceTask.d.ts +1 -4
- package/dist/cjs/core/tasks/CheckBalanceTask.js +1 -2
- package/dist/cjs/core/tasks/CheckBalanceTask.js.map +1 -1
- package/dist/cjs/core/tasks/PrepareTransactionTask.d.ts +1 -4
- package/dist/cjs/core/tasks/PrepareTransactionTask.js +2 -3
- package/dist/cjs/core/tasks/PrepareTransactionTask.js.map +1 -1
- package/dist/cjs/core/tasks/WaitForTransactionStatusTask.d.ts +1 -4
- package/dist/cjs/core/tasks/WaitForTransactionStatusTask.js +2 -3
- package/dist/cjs/core/tasks/WaitForTransactionStatusTask.js.map +1 -1
- package/dist/cjs/core/tasks/helpers/checkBalance.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/checkBalance.js +2 -3
- package/dist/cjs/core/tasks/helpers/getStepStatusRequest.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/getStepStatusRequest.js +1 -2
- package/dist/cjs/core/tasks/helpers/getTransactionRequestData.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/getTransactionRequestData.js +1 -2
- package/dist/cjs/core/tasks/helpers/isKnownToStatusApi.d.ts +1 -4
- package/dist/cjs/core/tasks/helpers/isKnownToStatusApi.js +1 -2
- package/dist/cjs/core/tasks/helpers/isKnownToStatusApi.js.map +1 -1
- package/dist/cjs/core/tasks/helpers/stepComparison.d.ts +2 -5
- package/dist/cjs/core/tasks/helpers/stepComparison.js +2 -3
- package/dist/cjs/core/tasks/helpers/waitForTransactionStatus.d.ts +1 -3
- package/dist/cjs/core/tasks/helpers/waitForTransactionStatus.js +3 -4
- package/dist/cjs/core/transactionState.d.ts +2 -5
- package/dist/cjs/core/transactionState.js +1 -2
- package/dist/cjs/core/utils.d.ts +1 -4
- package/dist/cjs/core/utils.js +1 -2
- package/dist/cjs/errors/SDKError.d.ts +2 -5
- package/dist/cjs/errors/SDKError.js +1 -2
- package/dist/cjs/errors/SDKError.js.map +1 -1
- package/dist/cjs/errors/baseError.d.ts +1 -4
- package/dist/cjs/errors/baseError.js +1 -2
- package/dist/cjs/errors/baseError.js.map +1 -1
- package/dist/cjs/errors/constants.d.ts +1 -4
- package/dist/cjs/errors/constants.js +1 -2
- package/dist/cjs/errors/errors.d.ts +2 -5
- package/dist/cjs/errors/errors.js +1 -2
- package/dist/cjs/errors/errors.js.map +1 -1
- package/dist/cjs/errors/httpError.d.ts +2 -4
- package/dist/cjs/errors/httpError.js +1 -2
- package/dist/cjs/errors/httpError.js.map +1 -1
- package/dist/cjs/errors/utils/baseErrorRootCause.d.ts +1 -4
- package/dist/cjs/errors/utils/baseErrorRootCause.js +1 -2
- package/dist/cjs/errors/utils/rootCause.d.ts +1 -4
- package/dist/cjs/errors/utils/rootCause.js +1 -2
- package/dist/cjs/index.d.ts +17 -16
- package/dist/cjs/index.js +24 -21
- package/dist/cjs/types/actions.d.ts +1 -3
- package/dist/cjs/types/core.d.ts +1 -4
- package/dist/cjs/types/execution.d.ts +2 -5
- package/dist/cjs/types/request.d.ts +1 -4
- package/dist/cjs/utils/abort.d.ts +1 -4
- package/dist/cjs/utils/abort.js +1 -2
- package/dist/cjs/utils/checkPackageUpdates.d.ts +1 -4
- package/dist/cjs/utils/checkPackageUpdates.js +2 -3
- package/dist/cjs/utils/convertQuoteToRoute.d.ts +1 -3
- package/dist/cjs/utils/convertQuoteToRoute.js +2 -3
- package/dist/cjs/utils/decode.d.ts +1 -4
- package/dist/cjs/utils/decode.js +1 -2
- package/dist/cjs/utils/fetchTxErrorDetails.d.ts +1 -4
- package/dist/cjs/utils/fetchTxErrorDetails.js +4 -2
- package/dist/cjs/utils/fetchTxErrorDetails.js.map +1 -1
- package/dist/cjs/utils/formatUnits.d.ts +1 -4
- package/dist/cjs/utils/formatUnits.js +1 -2
- package/dist/cjs/utils/getTransactionMessage.d.ts +1 -4
- package/dist/cjs/utils/getTransactionMessage.js +1 -2
- package/dist/cjs/utils/isGaslessStep.d.ts +13 -0
- package/dist/cjs/utils/isGaslessStep.js +20 -0
- package/dist/cjs/utils/isGaslessStep.js.map +1 -0
- package/dist/cjs/utils/isHex.d.ts +1 -4
- package/dist/cjs/utils/isHex.js +1 -2
- package/dist/cjs/utils/isRoutesRequest.d.ts +1 -4
- package/dist/cjs/utils/isRoutesRequest.js +1 -2
- package/dist/cjs/utils/isStep.d.ts +1 -4
- package/dist/cjs/utils/isStep.js +1 -2
- package/dist/cjs/utils/isToken.d.ts +1 -4
- package/dist/cjs/utils/isToken.js +1 -2
- package/dist/cjs/utils/lru.d.ts +1 -4
- package/dist/cjs/utils/lru.js +1 -2
- package/dist/cjs/utils/lru.js.map +1 -1
- package/dist/cjs/utils/parseUnits.d.ts +1 -4
- package/dist/cjs/utils/parseUnits.js +1 -2
- package/dist/cjs/utils/request.d.ts +2 -5
- package/dist/cjs/utils/request.js +3 -4
- package/dist/cjs/utils/sleep.d.ts +1 -4
- package/dist/cjs/utils/sleep.js +1 -2
- package/dist/cjs/utils/toQueryString.d.ts +1 -4
- package/dist/cjs/utils/toQueryString.js +1 -2
- package/dist/cjs/utils/waitForResult.d.ts +1 -4
- package/dist/cjs/utils/waitForResult.js +1 -2
- package/dist/cjs/utils/withDedupe.d.ts +1 -3
- package/dist/cjs/utils/withDedupe.js +1 -2
- package/dist/cjs/utils/withDedupe.js.map +1 -1
- package/dist/cjs/utils/withTimeout.d.ts +1 -4
- package/dist/cjs/utils/withTimeout.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/actions/getChains.d.ts +0 -2
- package/dist/esm/actions/getChains.d.ts.map +1 -1
- package/dist/esm/actions/getChains.js +1 -2
- package/dist/esm/actions/getConnections.d.ts +0 -2
- package/dist/esm/actions/getConnections.d.ts.map +1 -1
- package/dist/esm/actions/getConnections.js +1 -2
- package/dist/esm/actions/getContractCallsQuote.d.ts +0 -2
- package/dist/esm/actions/getContractCallsQuote.d.ts.map +1 -1
- package/dist/esm/actions/getContractCallsQuote.js +2 -3
- package/dist/esm/actions/getGasRecommendation.d.ts +0 -2
- package/dist/esm/actions/getGasRecommendation.d.ts.map +1 -1
- package/dist/esm/actions/getGasRecommendation.js +2 -3
- package/dist/esm/actions/getNameServiceAddress.d.ts +0 -2
- package/dist/esm/actions/getNameServiceAddress.d.ts.map +1 -1
- package/dist/esm/actions/getNameServiceAddress.js +1 -2
- package/dist/esm/actions/getQuote.d.ts +1 -3
- package/dist/esm/actions/getQuote.d.ts.map +1 -1
- package/dist/esm/actions/getQuote.js +2 -3
- package/dist/esm/actions/getRelayedTransactionStatus.d.ts +0 -2
- package/dist/esm/actions/getRelayedTransactionStatus.d.ts.map +1 -1
- package/dist/esm/actions/getRelayedTransactionStatus.js +3 -4
- package/dist/esm/actions/getRelayerQuote.d.ts +16 -10
- package/dist/esm/actions/getRelayerQuote.d.ts.map +1 -1
- package/dist/esm/actions/getRelayerQuote.js +18 -35
- package/dist/esm/actions/getRelayerQuote.js.map +1 -1
- package/dist/esm/actions/getRoutes.d.ts +1 -3
- package/dist/esm/actions/getRoutes.d.ts.map +1 -1
- package/dist/esm/actions/getRoutes.js +3 -4
- package/dist/esm/actions/getStatus.d.ts +1 -3
- package/dist/esm/actions/getStatus.d.ts.map +1 -1
- package/dist/esm/actions/getStatus.js +2 -3
- package/dist/esm/actions/getStepTransaction.d.ts +1 -3
- package/dist/esm/actions/getStepTransaction.d.ts.map +1 -1
- package/dist/esm/actions/getStepTransaction.js +2 -3
- package/dist/esm/actions/getToken.d.ts +0 -2
- package/dist/esm/actions/getToken.d.ts.map +1 -1
- package/dist/esm/actions/getToken.js +2 -3
- package/dist/esm/actions/getTokenBalance.d.ts +0 -2
- package/dist/esm/actions/getTokenBalance.d.ts.map +1 -1
- package/dist/esm/actions/getTokenBalance.js +1 -2
- package/dist/esm/actions/getTokenBalances.d.ts +0 -2
- package/dist/esm/actions/getTokenBalances.d.ts.map +1 -1
- package/dist/esm/actions/getTokenBalances.js +1 -2
- package/dist/esm/actions/getTokenBalancesByChain.d.ts +0 -2
- package/dist/esm/actions/getTokenBalancesByChain.d.ts.map +1 -1
- package/dist/esm/actions/getTokenBalancesByChain.js +1 -2
- package/dist/esm/actions/getTokens.d.ts +0 -2
- package/dist/esm/actions/getTokens.d.ts.map +1 -1
- package/dist/esm/actions/getTokens.js +1 -2
- package/dist/esm/actions/getTools.d.ts +0 -2
- package/dist/esm/actions/getTools.d.ts.map +1 -1
- package/dist/esm/actions/getTools.js +1 -2
- package/dist/esm/actions/getTransactionHistory.d.ts +0 -2
- package/dist/esm/actions/getTransactionHistory.d.ts.map +1 -1
- package/dist/esm/actions/getTransactionHistory.js +1 -2
- package/dist/esm/actions/index.d.ts +3 -3
- package/dist/esm/actions/index.d.ts.map +1 -1
- package/dist/esm/actions/index.js +4 -5
- package/dist/esm/actions/index.js.map +1 -1
- package/dist/esm/actions/patchContractCalls.d.ts +0 -2
- package/dist/esm/actions/patchContractCalls.d.ts.map +1 -1
- package/dist/esm/actions/patchContractCalls.js +1 -2
- package/dist/esm/actions/relayTransaction.d.ts +0 -2
- package/dist/esm/actions/relayTransaction.d.ts.map +1 -1
- package/dist/esm/actions/relayTransaction.js +3 -5
- package/dist/esm/actions/relayTransaction.js.map +1 -1
- package/dist/esm/client/createClient.d.ts +0 -2
- package/dist/esm/client/createClient.d.ts.map +1 -1
- package/dist/esm/client/createClient.js +2 -3
- package/dist/esm/client/findProvider.d.ts +0 -2
- package/dist/esm/client/findProvider.d.ts.map +1 -1
- package/dist/esm/client/findProvider.js +1 -2
- package/dist/esm/client/getClientStorage.d.ts +0 -2
- package/dist/esm/client/getClientStorage.d.ts.map +1 -1
- package/dist/esm/client/getClientStorage.js +1 -2
- package/dist/esm/core/BaseStepExecutionTask.d.ts +0 -2
- package/dist/esm/core/BaseStepExecutionTask.d.ts.map +1 -1
- package/dist/esm/core/BaseStepExecutionTask.js +1 -2
- package/dist/esm/core/BaseStepExecutor.d.ts +3 -5
- package/dist/esm/core/BaseStepExecutor.d.ts.map +1 -1
- package/dist/esm/core/BaseStepExecutor.js +3 -4
- package/dist/esm/core/BaseStepExecutor.js.map +1 -1
- package/dist/esm/core/StatusManager.d.ts +1 -2
- package/dist/esm/core/StatusManager.d.ts.map +1 -1
- package/dist/esm/core/StatusManager.js +1 -2
- package/dist/esm/core/StatusManager.js.map +1 -1
- package/dist/esm/core/TaskPipeline.d.ts +0 -2
- package/dist/esm/core/TaskPipeline.d.ts.map +1 -1
- package/dist/esm/core/TaskPipeline.js +1 -2
- package/dist/esm/core/TaskPipeline.js.map +1 -1
- package/dist/esm/core/actionMessages.d.ts +0 -2
- package/dist/esm/core/actionMessages.d.ts.map +1 -1
- package/dist/esm/core/actionMessages.js +1 -2
- package/dist/esm/core/execution.d.ts +0 -2
- package/dist/esm/core/execution.d.ts.map +1 -1
- package/dist/esm/core/execution.js +1 -2
- package/dist/esm/core/executionState.d.ts +1 -2
- package/dist/esm/core/executionState.d.ts.map +1 -1
- package/dist/esm/core/executionState.js +1 -2
- package/dist/esm/core/prepareRestart.d.ts +0 -2
- package/dist/esm/core/prepareRestart.d.ts.map +1 -1
- package/dist/esm/core/prepareRestart.js +1 -2
- package/dist/esm/core/storage.d.ts +0 -2
- package/dist/esm/core/storage.d.ts.map +1 -1
- package/dist/esm/core/storage.js +1 -2
- package/dist/esm/core/storage.js.map +1 -1
- package/dist/esm/core/tasks/CheckBalanceTask.d.ts +0 -2
- package/dist/esm/core/tasks/CheckBalanceTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/CheckBalanceTask.js +1 -2
- package/dist/esm/core/tasks/CheckBalanceTask.js.map +1 -1
- package/dist/esm/core/tasks/PrepareTransactionTask.d.ts +0 -2
- package/dist/esm/core/tasks/PrepareTransactionTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/PrepareTransactionTask.js +2 -3
- package/dist/esm/core/tasks/PrepareTransactionTask.js.map +1 -1
- package/dist/esm/core/tasks/WaitForTransactionStatusTask.d.ts +0 -2
- package/dist/esm/core/tasks/WaitForTransactionStatusTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/WaitForTransactionStatusTask.js +2 -3
- package/dist/esm/core/tasks/WaitForTransactionStatusTask.js.map +1 -1
- package/dist/esm/core/tasks/helpers/checkBalance.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/checkBalance.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/checkBalance.js +2 -3
- package/dist/esm/core/tasks/helpers/getStepStatusRequest.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/getStepStatusRequest.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/getStepStatusRequest.js +1 -2
- package/dist/esm/core/tasks/helpers/getTransactionRequestData.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/getTransactionRequestData.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/getTransactionRequestData.js +1 -2
- package/dist/esm/core/tasks/helpers/isKnownToStatusApi.d.ts +0 -2
- package/dist/esm/core/tasks/helpers/isKnownToStatusApi.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/isKnownToStatusApi.js +1 -2
- package/dist/esm/core/tasks/helpers/isKnownToStatusApi.js.map +1 -1
- package/dist/esm/core/tasks/helpers/stepComparison.d.ts +1 -3
- package/dist/esm/core/tasks/helpers/stepComparison.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/stepComparison.js +2 -3
- package/dist/esm/core/tasks/helpers/waitForTransactionStatus.d.ts +1 -2
- package/dist/esm/core/tasks/helpers/waitForTransactionStatus.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/waitForTransactionStatus.js +3 -4
- package/dist/esm/core/transactionState.d.ts +1 -3
- package/dist/esm/core/transactionState.d.ts.map +1 -1
- package/dist/esm/core/transactionState.js +1 -2
- package/dist/esm/core/utils.d.ts +0 -2
- package/dist/esm/core/utils.d.ts.map +1 -1
- package/dist/esm/core/utils.js +1 -2
- package/dist/esm/errors/SDKError.d.ts +1 -3
- package/dist/esm/errors/SDKError.d.ts.map +1 -1
- package/dist/esm/errors/SDKError.js +1 -2
- package/dist/esm/errors/SDKError.js.map +1 -1
- package/dist/esm/errors/baseError.d.ts +0 -2
- package/dist/esm/errors/baseError.d.ts.map +1 -1
- package/dist/esm/errors/baseError.js +1 -2
- package/dist/esm/errors/baseError.js.map +1 -1
- package/dist/esm/errors/constants.d.ts +0 -2
- package/dist/esm/errors/constants.d.ts.map +1 -1
- package/dist/esm/errors/constants.js +1 -2
- package/dist/esm/errors/errors.d.ts +1 -3
- package/dist/esm/errors/errors.d.ts.map +1 -1
- package/dist/esm/errors/errors.js +1 -2
- package/dist/esm/errors/errors.js.map +1 -1
- package/dist/esm/errors/httpError.d.ts +2 -3
- package/dist/esm/errors/httpError.d.ts.map +1 -1
- package/dist/esm/errors/httpError.js +1 -2
- package/dist/esm/errors/httpError.js.map +1 -1
- package/dist/esm/errors/utils/baseErrorRootCause.d.ts +0 -2
- package/dist/esm/errors/utils/baseErrorRootCause.d.ts.map +1 -1
- package/dist/esm/errors/utils/baseErrorRootCause.js +1 -2
- package/dist/esm/errors/utils/rootCause.d.ts +0 -2
- package/dist/esm/errors/utils/rootCause.d.ts.map +1 -1
- package/dist/esm/errors/utils/rootCause.js +1 -2
- package/dist/esm/index.d.ts +17 -16
- package/dist/esm/index.js +23 -22
- package/dist/esm/types/actions.d.ts +1 -2
- package/dist/esm/types/actions.d.ts.map +1 -1
- package/dist/esm/types/core.d.ts +0 -2
- package/dist/esm/types/core.d.ts.map +1 -1
- package/dist/esm/types/execution.d.ts +1 -3
- package/dist/esm/types/execution.d.ts.map +1 -1
- package/dist/esm/types/request.d.ts +0 -2
- package/dist/esm/types/request.d.ts.map +1 -1
- package/dist/esm/utils/abort.d.ts +0 -2
- package/dist/esm/utils/abort.d.ts.map +1 -1
- package/dist/esm/utils/abort.js +1 -2
- package/dist/esm/utils/checkPackageUpdates.d.ts +0 -2
- package/dist/esm/utils/checkPackageUpdates.d.ts.map +1 -1
- package/dist/esm/utils/checkPackageUpdates.js +2 -3
- package/dist/esm/utils/convertQuoteToRoute.d.ts +1 -2
- package/dist/esm/utils/convertQuoteToRoute.d.ts.map +1 -1
- package/dist/esm/utils/convertQuoteToRoute.js +2 -3
- package/dist/esm/utils/decode.d.ts +0 -2
- package/dist/esm/utils/decode.d.ts.map +1 -1
- package/dist/esm/utils/decode.js +1 -2
- package/dist/esm/utils/fetchTxErrorDetails.d.ts +0 -2
- package/dist/esm/utils/fetchTxErrorDetails.d.ts.map +1 -1
- package/dist/esm/utils/fetchTxErrorDetails.js +4 -2
- package/dist/esm/utils/fetchTxErrorDetails.js.map +1 -1
- package/dist/esm/utils/formatUnits.d.ts +0 -2
- package/dist/esm/utils/formatUnits.d.ts.map +1 -1
- package/dist/esm/utils/formatUnits.js +1 -2
- package/dist/esm/utils/getTransactionMessage.d.ts +0 -2
- package/dist/esm/utils/getTransactionMessage.d.ts.map +1 -1
- package/dist/esm/utils/getTransactionMessage.js +1 -2
- package/dist/esm/utils/isGaslessStep.d.ts +14 -0
- package/dist/esm/utils/isGaslessStep.d.ts.map +1 -0
- package/dist/esm/utils/isGaslessStep.js +18 -0
- package/dist/esm/utils/isGaslessStep.js.map +1 -0
- package/dist/esm/utils/isHex.d.ts +0 -2
- package/dist/esm/utils/isHex.d.ts.map +1 -1
- package/dist/esm/utils/isHex.js +1 -2
- package/dist/esm/utils/isRoutesRequest.d.ts +0 -2
- package/dist/esm/utils/isRoutesRequest.d.ts.map +1 -1
- package/dist/esm/utils/isRoutesRequest.js +1 -2
- package/dist/esm/utils/isStep.d.ts +0 -2
- package/dist/esm/utils/isStep.d.ts.map +1 -1
- package/dist/esm/utils/isStep.js +1 -2
- package/dist/esm/utils/isToken.d.ts +0 -2
- package/dist/esm/utils/isToken.d.ts.map +1 -1
- package/dist/esm/utils/isToken.js +1 -2
- package/dist/esm/utils/lru.d.ts +0 -2
- package/dist/esm/utils/lru.d.ts.map +1 -1
- package/dist/esm/utils/lru.js +1 -2
- package/dist/esm/utils/lru.js.map +1 -1
- package/dist/esm/utils/parseUnits.d.ts +0 -2
- package/dist/esm/utils/parseUnits.d.ts.map +1 -1
- package/dist/esm/utils/parseUnits.js +1 -2
- package/dist/esm/utils/request.d.ts +1 -3
- package/dist/esm/utils/request.d.ts.map +1 -1
- package/dist/esm/utils/request.js +3 -4
- package/dist/esm/utils/sleep.d.ts +0 -2
- package/dist/esm/utils/sleep.d.ts.map +1 -1
- package/dist/esm/utils/sleep.js +1 -2
- package/dist/esm/utils/toQueryString.d.ts +0 -2
- package/dist/esm/utils/toQueryString.d.ts.map +1 -1
- package/dist/esm/utils/toQueryString.js +1 -2
- package/dist/esm/utils/waitForResult.d.ts +0 -2
- package/dist/esm/utils/waitForResult.d.ts.map +1 -1
- package/dist/esm/utils/waitForResult.js +1 -2
- package/dist/esm/utils/withDedupe.d.ts +1 -2
- package/dist/esm/utils/withDedupe.d.ts.map +1 -1
- package/dist/esm/utils/withDedupe.js +1 -2
- package/dist/esm/utils/withTimeout.d.ts +0 -2
- package/dist/esm/utils/withTimeout.d.ts.map +1 -1
- package/dist/esm/utils/withTimeout.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 +2 -2
- package/src/actions/getRelayerQuote.ts +26 -76
- package/src/actions/index.ts +3 -1
- package/src/actions/relayTransaction.ts +1 -9
- package/src/core/tasks/CheckBalanceTask.ts +1 -1
- package/src/index.ts +2 -2
- package/src/types/core.ts +3 -2
- package/src/utils/fetchTxErrorDetails.ts +16 -0
- package/src/utils/isGaslessStep.ts +21 -0
- package/src/version.ts +1 -1
package/dist/esm/utils/isHex.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/isHex.ts
|
|
2
2
|
function isHex(value, { strict = true } = {}) {
|
|
3
3
|
if (!value) return false;
|
|
4
4
|
if (typeof value !== "string") return false;
|
|
5
5
|
return strict ? /^0x[0-9a-fA-F]*$/.test(value) : value.startsWith("0x");
|
|
6
6
|
}
|
|
7
|
-
//#endregion
|
|
8
7
|
export { isHex };
|
|
9
8
|
|
|
10
9
|
//# sourceMappingURL=isHex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isRoutesRequest.d.ts","names":[],"sources":["../../../src/utils/isRoutesRequest.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"isRoutesRequest.d.ts","names":[],"sources":["../../../src/utils/isRoutesRequest.ts"],"mappings":";qBAOa,kBACX,eAAe,kBACd,iBAAiB"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/isRoutesRequest.ts
|
|
2
2
|
const isRoutesOptions = (routeOptions) => !routeOptions?.slippage || typeof routeOptions.slippage === "number";
|
|
3
3
|
const isRoutesRequest = (routesRequest) => {
|
|
4
4
|
const { fromChainId, fromAmount, fromTokenAddress, toChainId, toTokenAddress, options } = routesRequest;
|
|
5
5
|
return typeof fromChainId === "number" && typeof fromAmount === "string" && fromAmount !== "" && typeof fromTokenAddress === "string" && fromTokenAddress !== "" && typeof toChainId === "number" && typeof toTokenAddress === "string" && toTokenAddress !== "" && (!options || isRoutesOptions(options));
|
|
6
6
|
};
|
|
7
|
-
//#endregion
|
|
8
7
|
export { isRoutesRequest };
|
|
9
8
|
|
|
10
9
|
//# sourceMappingURL=isRoutesRequest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isStep.d.ts","names":[],"sources":["../../../src/utils/isStep.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"isStep.d.ts","names":[],"sources":["../../../src/utils/isStep.ts"],"mappings":";qBAiCa,SAAU,MAAM,aAAW,QAAQ"}
|
package/dist/esm/utils/isStep.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isToken } from "./isToken.js";
|
|
2
|
-
|
|
2
|
+
// src/utils/isStep.ts
|
|
3
3
|
const isAction = (action) => {
|
|
4
4
|
const { fromChainId, fromAmount, fromToken, toChainId, toToken } = action;
|
|
5
5
|
return typeof fromChainId === "number" && typeof fromAmount === "string" && fromAmount !== "" && isToken(fromToken) && typeof toChainId === "number" && isToken(toToken);
|
|
@@ -17,7 +17,6 @@ const isStep = (step) => {
|
|
|
17
17
|
"lifi"
|
|
18
18
|
].includes(type) && typeof tool === "string" && isAction(action) && (!estimate || isEstimate(estimate));
|
|
19
19
|
};
|
|
20
|
-
//#endregion
|
|
21
20
|
export { isStep };
|
|
22
21
|
|
|
23
22
|
//# sourceMappingURL=isStep.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isToken.d.ts","names":[],"sources":["../../../src/utils/isToken.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"isToken.d.ts","names":[],"sources":["../../../src/utils/isToken.ts"],"mappings":";qBAEa,UAAW,OAAO,gBAAc,SAAS"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/isToken.ts
|
|
2
2
|
const isToken = (token) => {
|
|
3
3
|
const { address, decimals, chainId } = token;
|
|
4
4
|
return typeof address === "string" && typeof decimals === "number" && typeof chainId === "number";
|
|
5
5
|
};
|
|
6
|
-
//#endregion
|
|
7
6
|
export { isToken };
|
|
8
7
|
|
|
9
8
|
//# sourceMappingURL=isToken.js.map
|
package/dist/esm/utils/lru.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/lru.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Map with a LRU (Least recently used) policy.
|
|
4
3
|
*
|
|
@@ -10,5 +9,4 @@ export declare class LruMap<value = unknown> extends Map<string, value> {
|
|
|
10
9
|
override get(key: string): value | undefined;
|
|
11
10
|
override set(key: string, value: value): this;
|
|
12
11
|
}
|
|
13
|
-
//#endregion
|
|
14
12
|
//# sourceMappingURL=lru.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lru.d.ts","names":[],"sources":["../../../src/utils/lru.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"lru.d.ts","names":[],"sources":["../../../src/utils/lru.ts"],"mappings":";;;;;qBAKa,OAAO,yBAAyB,YAAY;EACvD;EAEA,YAAY;WAKH,IAAI,cAAc;WASlB,IAAI,aAAa,OAAO"}
|
package/dist/esm/utils/lru.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/lru.ts
|
|
2
2
|
/**
|
|
3
3
|
* Map with a LRU (Least recently used) policy.
|
|
4
4
|
*
|
|
@@ -28,7 +28,6 @@ var LruMap = class extends Map {
|
|
|
28
28
|
return this;
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
//#endregion
|
|
32
31
|
export { LruMap };
|
|
33
32
|
|
|
34
33
|
//# sourceMappingURL=lru.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lru.js","names":[],"sources":["../../../src/utils/lru.ts"],"sourcesContent":["/**\n * Map with a LRU (Least recently used) policy.\n *\n * https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU\n */\nexport class LruMap<value = unknown> extends Map<string, value> {\n maxSize: number\n\n constructor(size: number) {\n super()\n this.maxSize = size\n }\n\n override get(key: string): value | undefined {\n const value = super.get(key)\n if (super.has(key)) {\n super.delete(key)\n super.set(key, value as value)\n }\n return value\n }\n\n override set(key: string, value: value): this {\n if (super.has(key)) {\n super.delete(key)\n }\n super.set(key, value)\n if (this.maxSize && this.size > this.maxSize) {\n // `super.keys()`, not `this.keys()`: on iOS 18 the subclass iterator\n // can yield `undefined`, and the map then grows without limit.\n const firstKey = super.keys().next().value\n if (firstKey !== undefined) {\n super.delete(firstKey)\n }\n }\n return this\n }\n}\n"],"mappings":";;;;;;AAKA,IAAa,SAAb,cAA6C,IAAmB;CAC9D;CAEA,YAAY,MAAc;EACxB,MAAM;EACN,KAAK,UAAU;CACjB;
|
|
1
|
+
{"version":3,"file":"lru.js","names":[],"sources":["../../../src/utils/lru.ts"],"sourcesContent":["/**\n * Map with a LRU (Least recently used) policy.\n *\n * https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU\n */\nexport class LruMap<value = unknown> extends Map<string, value> {\n maxSize: number\n\n constructor(size: number) {\n super()\n this.maxSize = size\n }\n\n override get(key: string): value | undefined {\n const value = super.get(key)\n if (super.has(key)) {\n super.delete(key)\n super.set(key, value as value)\n }\n return value\n }\n\n override set(key: string, value: value): this {\n if (super.has(key)) {\n super.delete(key)\n }\n super.set(key, value)\n if (this.maxSize && this.size > this.maxSize) {\n // `super.keys()`, not `this.keys()`: on iOS 18 the subclass iterator\n // can yield `undefined`, and the map then grows without limit.\n const firstKey = super.keys().next().value\n if (firstKey !== undefined) {\n super.delete(firstKey)\n }\n }\n return this\n }\n}\n"],"mappings":";;;;;;AAKA,IAAa,SAAb,cAA6C,IAAmB;CAC9D;CAEA,YAAY,MAAc;EACxB,MAAM;EACN,KAAK,UAAU;CACjB;CAES,IAAI,KAAgC;EAC3C,MAAM,QAAQ,MAAM,IAAI,GAAG;EAC3B,IAAI,MAAM,IAAI,GAAG,GAAG;GAClB,MAAM,OAAO,GAAG;GAChB,MAAM,IAAI,KAAK,KAAc;EAC/B;EACA,OAAO;CACT;CAES,IAAI,KAAa,OAAoB;EAC5C,IAAI,MAAM,IAAI,GAAG,GACf,MAAM,OAAO,GAAG;EAElB,MAAM,IAAI,KAAK,KAAK;EACpB,IAAI,KAAK,WAAW,KAAK,OAAO,KAAK,SAAS;GAG5C,MAAM,WAAW,MAAM,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;GACrC,IAAI,aAAa,KAAA,GACf,MAAM,OAAO,QAAQ;EAEzB;EACA,OAAO;CACT;AACF"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
//#region src/utils/parseUnits.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Multiplies a string representation of a number by a given exponent of base 10 (10exponent).
|
|
4
3
|
*/
|
|
5
4
|
export declare function parseUnits(value: string, decimals: number): bigint;
|
|
6
|
-
//#endregion
|
|
7
5
|
//# sourceMappingURL=parseUnits.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseUnits.d.ts","names":[],"sources":["../../../src/utils/parseUnits.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"parseUnits.d.ts","names":[],"sources":["../../../src/utils/parseUnits.ts"],"mappings":";;;wBAGgB,WAAW,eAAe"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/parseUnits.ts
|
|
2
2
|
/**
|
|
3
3
|
* Multiplies a string representation of a number by a given exponent of base 10 (10exponent).
|
|
4
4
|
*/
|
|
@@ -42,7 +42,6 @@ function carry(digits) {
|
|
|
42
42
|
}
|
|
43
43
|
return `1${out.join("")}`;
|
|
44
44
|
}
|
|
45
|
-
//#endregion
|
|
46
45
|
export { parseUnits };
|
|
47
46
|
|
|
48
47
|
//# sourceMappingURL=parseUnits.js.map
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { ExtendedRequestInit } from "../types/request.js";
|
|
2
1
|
import { SDKBaseConfig } from "../types/core.js";
|
|
3
|
-
|
|
2
|
+
import { ExtendedRequestInit } from "../types/request.js";
|
|
4
3
|
export declare const requestSettings: {
|
|
5
4
|
retries: number;
|
|
6
5
|
};
|
|
7
6
|
export declare const request: <T = Response>(config: SDKBaseConfig, url: RequestInfo | URL, options?: ExtendedRequestInit) => Promise<T>;
|
|
8
|
-
//#endregion
|
|
9
7
|
//# sourceMappingURL=request.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","names":[],"sources":["../../../src/utils/request.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"request.d.ts","names":[],"sources":["../../../src/utils/request.ts"],"mappings":";;qBAQa;EACX;;qBAUW,UAAiB,IAAI,UAChC,QAAQ,eACR,KAAK,cAAc,KACnB,UAAS,wBAGR,QAAQ"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { version } from "../version.js";
|
|
2
|
-
import { SDKError } from "../errors/SDKError.js";
|
|
3
1
|
import { ValidationError } from "../errors/errors.js";
|
|
4
2
|
import { HTTPError } from "../errors/httpError.js";
|
|
3
|
+
import { SDKError } from "../errors/SDKError.js";
|
|
4
|
+
import { version } from "../version.js";
|
|
5
5
|
import { sleep } from "./sleep.js";
|
|
6
|
-
|
|
6
|
+
// src/utils/request.ts
|
|
7
7
|
const requestSettings = { retries: 1 };
|
|
8
8
|
const stripExtendRequestInitProperties = ({ retries, ...rest }) => ({ ...rest });
|
|
9
9
|
const request = async (config, url, options = { retries: requestSettings.retries }) => {
|
|
@@ -48,7 +48,6 @@ const request = async (config, url, options = { retries: requestSettings.retries
|
|
|
48
48
|
throw new SDKError(error);
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
-
//#endregion
|
|
52
51
|
export { request, requestSettings };
|
|
53
52
|
|
|
54
53
|
//# sourceMappingURL=request.js.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/sleep.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Resolves with `null` after `ms`. With a `signal`, it rejects with the abort
|
|
4
3
|
* reason as soon as the signal aborts, and clears its timer.
|
|
@@ -6,5 +5,4 @@
|
|
|
6
5
|
export declare function sleep(ms: number, { signal }?: {
|
|
7
6
|
signal?: AbortSignal | undefined;
|
|
8
7
|
}): Promise<null>;
|
|
9
|
-
//#endregion
|
|
10
8
|
//# sourceMappingURL=sleep.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sleep.d.ts","names":[],"sources":["../../../src/utils/sleep.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"sleep.d.ts","names":[],"sources":["../../../src/utils/sleep.ts"],"mappings":";;;;wBAMgB,MACd,cACE;EAAY,SAAS;IACtB"}
|
package/dist/esm/utils/sleep.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getAbortError } from "./abort.js";
|
|
2
|
-
|
|
2
|
+
// src/utils/sleep.ts
|
|
3
3
|
/**
|
|
4
4
|
* Resolves with `null` after `ms`. With a `signal`, it rejects with the abort
|
|
5
5
|
* reason as soon as the signal aborts, and clears its timer.
|
|
@@ -23,7 +23,6 @@ function sleep(ms, { signal } = {}) {
|
|
|
23
23
|
signal?.addEventListener("abort", onAbort, { once: true });
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
//#endregion
|
|
27
26
|
export { sleep };
|
|
28
27
|
|
|
29
28
|
//# sourceMappingURL=sleep.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toQueryString.d.ts","names":[],"sources":["../../../src/utils/toQueryString.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"toQueryString.d.ts","names":[],"sources":["../../../src/utils/toQueryString.ts"],"mappings":"A,qBA+Ba,gBAAiB,QAAQ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/toQueryString.ts
|
|
2
2
|
const isPrimitive = (value) => typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "bigint";
|
|
3
3
|
const serialize = (key, value) => {
|
|
4
4
|
if (value === void 0 || value === null) return [];
|
|
@@ -10,7 +10,6 @@ const serialize = (key, value) => {
|
|
|
10
10
|
return Object.entries(value).flatMap(([subKey, subValue]) => serialize(`${key}[${subKey}]`, subValue));
|
|
11
11
|
};
|
|
12
12
|
const toQueryString = (params) => Object.entries(params).flatMap(([key, value]) => serialize(key, value)).join("&");
|
|
13
|
-
//#endregion
|
|
14
13
|
export { toQueryString };
|
|
15
14
|
|
|
16
15
|
//# sourceMappingURL=toQueryString.js.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/waitForResult.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Repeatedly calls a given asynchronous function until it resolves with a truthy value
|
|
4
3
|
* @param fn The function that should be repeated. A falsy result means "no result yet" and polls again, with no limit on the number of polls
|
|
@@ -11,5 +10,4 @@
|
|
|
11
10
|
* @throws The abort reason of `signal` once it aborts
|
|
12
11
|
*/
|
|
13
12
|
export declare const waitForResult: <T>(fn: () => Promise<T | undefined>, interval?: number | ((poll: number) => number), maxRetries?: number, shouldRetry?: (count: number, error: unknown) => boolean, signal?: AbortSignal) => Promise<T>;
|
|
14
|
-
//#endregion
|
|
15
13
|
//# sourceMappingURL=waitForResult.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waitForResult.d.ts","names":[],"sources":["../../../src/utils/waitForResult.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"waitForResult.d.ts","names":[],"sources":["../../../src/utils/waitForResult.ts"],"mappings":";;;;;;;;;;;qBAca,gBAAuB,GAClC,UAAU,QAAQ,gBAClB,sBAAqB,0BACrB,qBACA,eAAc,eAAe,4BAC7B,SAAS,gBACR,QAAQ"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAbortError } from "./abort.js";
|
|
2
2
|
import { sleep } from "./sleep.js";
|
|
3
|
-
|
|
3
|
+
// src/utils/waitForResult.ts
|
|
4
4
|
/**
|
|
5
5
|
* Repeatedly calls a given asynchronous function until it resolves with a truthy value
|
|
6
6
|
* @param fn The function that should be repeated. A falsy result means "no result yet" and polls again, with no limit on the number of polls
|
|
@@ -34,7 +34,6 @@ const waitForResult = async (fn, interval = 5e3, maxRetries = 3, shouldRetry = (
|
|
|
34
34
|
}
|
|
35
35
|
return result;
|
|
36
36
|
};
|
|
37
|
-
//#endregion
|
|
38
37
|
export { waitForResult };
|
|
39
38
|
|
|
40
39
|
//# sourceMappingURL=waitForResult.js.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/withDedupe.d.ts
|
|
2
1
|
type WithDedupeOptions = {
|
|
3
2
|
enabled?: boolean | undefined;
|
|
4
3
|
id?: string | undefined;
|
|
@@ -18,5 +17,5 @@ export declare function withDedupe<T>(fn: (signal?: AbortSignal) => Promise<T>,
|
|
|
18
17
|
export declare function withDedupe<T>(fn: () => Promise<T>, options: WithDedupeOptions & {
|
|
19
18
|
signal?: undefined;
|
|
20
19
|
}): Promise<T>;
|
|
21
|
-
|
|
20
|
+
export {};
|
|
22
21
|
//# sourceMappingURL=withDedupe.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withDedupe.d.ts","names":[],"sources":["../../../src/utils/withDedupe.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"withDedupe.d.ts","names":[],"sources":["../../../src/utils/withDedupe.ts"],"mappings":"A,KAqBK;EACH;EACA;;EAEA,SAAS;;;;;;;;;;;wBAYK,WAAW,GACzB,KAAK,SAAS,gBAAgB,QAAQ,IACtC,SAAS,oBACR,QAAQ;wBACK,WAAW,GACzB,UAAU,QAAQ,IAClB,SAAS;EAAsB;IAC9B,QAAQ"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAbortError } from "./abort.js";
|
|
2
2
|
import { LruMap } from "./lru.js";
|
|
3
|
-
|
|
3
|
+
// src/utils/withDedupe.ts
|
|
4
4
|
/** @internal */
|
|
5
5
|
const promiseCache = /*#__PURE__*/ new LruMap(8192);
|
|
6
6
|
function withDedupe(fn, { enabled = true, id, signal }) {
|
|
@@ -72,7 +72,6 @@ function subscribe(inFlight) {
|
|
|
72
72
|
function evict(id, promise) {
|
|
73
73
|
if (promiseCache.get(id)?.promise === promise) promiseCache.delete(id);
|
|
74
74
|
}
|
|
75
|
-
//#endregion
|
|
76
75
|
export { withDedupe };
|
|
77
76
|
|
|
78
77
|
//# sourceMappingURL=withDedupe.js.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/withTimeout.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Wraps a function in a timeout.
|
|
4
3
|
* Based on viem's withTimeout implementation.
|
|
@@ -15,5 +14,4 @@ export declare function withTimeout<T>(fn: ({ signal }: {
|
|
|
15
14
|
timeout: number;
|
|
16
15
|
signal?: boolean | undefined;
|
|
17
16
|
}): Promise<T>;
|
|
18
|
-
//#endregion
|
|
19
17
|
//# sourceMappingURL=withTimeout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withTimeout.d.ts","names":[],"sources":["../../../src/utils/withTimeout.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"withTimeout.d.ts","names":[],"sources":["../../../src/utils/withTimeout.ts"],"mappings":";;;;;;;;;wBAWgB,YAAY,GAC1B,OAAO;EAAY,QAAQ;MAAuC,QAAQ,MAExE,eACA,SACA;EAGA,gBAAgB;EAEhB;EAEA;IAED,QAAQ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isAbortError } from "./abort.js";
|
|
2
|
-
|
|
2
|
+
// src/utils/withTimeout.ts
|
|
3
3
|
/**
|
|
4
4
|
* Wraps a function in a timeout.
|
|
5
5
|
* Based on viem's withTimeout implementation.
|
|
@@ -32,7 +32,6 @@ function withTimeout(fn, { errorInstance = /* @__PURE__ */ new Error("Timed out
|
|
|
32
32
|
})();
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
//#endregion
|
|
36
35
|
export { withTimeout };
|
|
37
36
|
|
|
38
37
|
//# sourceMappingURL=withTimeout.js.map
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","names":[],"sources":["../../src/version.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"version.d.ts","names":[],"sources":["../../src/version.ts"],"mappings":"A,qBAAa;qBACA"}
|
package/dist/esm/version.js
CHANGED
package/dist/esm/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","names":[],"sources":["../../src/version.ts"],"sourcesContent":["export const name = '@lifi/sdk'\nexport const version = '4.
|
|
1
|
+
{"version":3,"file":"version.js","names":[],"sources":["../../src/version.ts"],"sourcesContent":["export const name = '@lifi/sdk'\nexport const version = '4.13.0'\n"],"mappings":";AAAA,MAAa,OAAO;AACpB,MAAa,UAAU"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/sdk",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.13.0",
|
|
4
4
|
"description": "LI.FI SDK for Any-to-Any Cross-Chain-Swap",
|
|
5
5
|
"homepage": "https://github.com/lifinance/sdk",
|
|
6
6
|
"bugs": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"./package.json": "./package.json"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@lifi/types": "^
|
|
31
|
+
"@lifi/types": "^19.1.0"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
@@ -1,86 +1,36 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
LiFiStep,
|
|
3
|
-
RelayerQuoteResponse,
|
|
4
|
-
RequestOptions,
|
|
5
|
-
} from '@lifi/types'
|
|
1
|
+
import type { LiFiStep, RequestOptions } from '@lifi/types'
|
|
6
2
|
import { BaseError } from '../errors/baseError.js'
|
|
7
|
-
import { ErrorName } from '../errors/constants.js'
|
|
8
|
-
import { ValidationError } from '../errors/errors.js'
|
|
3
|
+
import { ErrorName, LiFiErrorCode } from '../errors/constants.js'
|
|
9
4
|
import { SDKError } from '../errors/SDKError.js'
|
|
10
|
-
import type {
|
|
5
|
+
import type { QuoteRequestFromAmount } from '../types/actions.js'
|
|
11
6
|
import type { SDKClient } from '../types/core.js'
|
|
12
|
-
import { request } from '../utils/request.js'
|
|
13
7
|
|
|
14
8
|
/**
|
|
15
|
-
* Get a relayer quote for a token transfer
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
9
|
+
* Get a relayer quote for a token transfer. The legacy gasless relayer service
|
|
10
|
+
* behind it is shut down, so this always rejects and sends no request.
|
|
11
|
+
*
|
|
12
|
+
* Kept only so that published consumers that still import it keep building.
|
|
13
|
+
* It stays `async`: callers such as `getRelayerQuote(...).catch(() => null)`
|
|
14
|
+
* need a rejected promise, not a synchronous throw.
|
|
15
|
+
* @param _client - The SDK client
|
|
16
|
+
* @param _params - The configuration of the requested quote
|
|
17
|
+
* @param _options - Request options
|
|
18
|
+
* @throws {SDKError} - Always, with a `NotFound` cause.
|
|
19
|
+
* @returns Never resolves with a quote.
|
|
20
|
+
* @deprecated The legacy gasless relayer service is shut down. Request
|
|
21
|
+
* gasless routes with `options.gasless: true` on `getRoutes`, or
|
|
22
|
+
* `gasless: true` on `getQuote`, and detect them with `isGaslessStep`.
|
|
21
23
|
*/
|
|
22
24
|
export const getRelayerQuote = async (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
_client: SDKClient,
|
|
26
|
+
_params: QuoteRequestFromAmount,
|
|
27
|
+
_options?: RequestOptions
|
|
26
28
|
): Promise<LiFiStep> => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
'toChain',
|
|
33
|
-
'toToken',
|
|
34
|
-
]
|
|
35
|
-
for (const requiredParameter of requiredParameters) {
|
|
36
|
-
if (!params[requiredParameter]) {
|
|
37
|
-
throw new SDKError(
|
|
38
|
-
new ValidationError(
|
|
39
|
-
`Required parameter "${requiredParameter}" is missing.`
|
|
40
|
-
)
|
|
41
|
-
)
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// apply defaults
|
|
46
|
-
params.integrator ??= client.config.integrator
|
|
47
|
-
params.order ??= client.config.routeOptions?.order
|
|
48
|
-
params.slippage ??= client.config.routeOptions?.slippage
|
|
49
|
-
params.referrer ??= client.config.routeOptions?.referrer
|
|
50
|
-
params.fee ??= client.config.routeOptions?.fee
|
|
51
|
-
params.allowBridges ??= client.config.routeOptions?.bridges?.allow
|
|
52
|
-
params.denyBridges ??= client.config.routeOptions?.bridges?.deny
|
|
53
|
-
params.preferBridges ??= client.config.routeOptions?.bridges?.prefer
|
|
54
|
-
params.allowExchanges ??= client.config.routeOptions?.exchanges?.allow
|
|
55
|
-
params.denyExchanges ??= client.config.routeOptions?.exchanges?.deny
|
|
56
|
-
params.preferExchanges ??= client.config.routeOptions?.exchanges?.prefer
|
|
57
|
-
|
|
58
|
-
for (const key of Object.keys(params)) {
|
|
59
|
-
if (
|
|
60
|
-
params[key as keyof QuoteRequest] === undefined ||
|
|
61
|
-
params[key as keyof QuoteRequest] === null
|
|
62
|
-
) {
|
|
63
|
-
delete params[key as keyof QuoteRequest]
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const result = await request<RelayerQuoteResponse>(
|
|
68
|
-
client.config,
|
|
69
|
-
`${client.config.apiUrl}/relayer/quote?${new URLSearchParams(
|
|
70
|
-
params as unknown as Record<string, string>
|
|
71
|
-
)}`,
|
|
72
|
-
{
|
|
73
|
-
signal: options?.signal,
|
|
74
|
-
}
|
|
75
|
-
)
|
|
76
|
-
|
|
77
|
-
if (result.status === 'error') {
|
|
78
|
-
throw new BaseError(
|
|
79
|
-
ErrorName.ServerError,
|
|
80
|
-
result.data.code,
|
|
81
|
-
result.data.message
|
|
29
|
+
throw new SDKError(
|
|
30
|
+
new BaseError(
|
|
31
|
+
ErrorName.NotFoundError,
|
|
32
|
+
LiFiErrorCode.NotFound,
|
|
33
|
+
'The legacy gasless relayer service is shut down. Request gasless routes with `options.gasless: true` on `getRoutes`.'
|
|
82
34
|
)
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return result.data
|
|
35
|
+
)
|
|
86
36
|
}
|
package/src/actions/index.ts
CHANGED
|
@@ -55,8 +55,8 @@ import { getTokens } from './getTokens.js'
|
|
|
55
55
|
import { getTools } from './getTools.js'
|
|
56
56
|
import { getTransactionHistory } from './getTransactionHistory.js'
|
|
57
57
|
import {
|
|
58
|
-
type PatchContractCallsResponse,
|
|
59
58
|
patchContractCalls,
|
|
59
|
+
type PatchContractCallsResponse,
|
|
60
60
|
} from './patchContractCalls.js'
|
|
61
61
|
import { relayTransaction } from './relayTransaction.js'
|
|
62
62
|
|
|
@@ -143,6 +143,8 @@ export type Actions = {
|
|
|
143
143
|
* @param params - The configuration of the requested relayer quote
|
|
144
144
|
* @param options - Request options
|
|
145
145
|
* @returns Quote from a relayer
|
|
146
|
+
* @deprecated The legacy gasless relayer service is shut down. Use
|
|
147
|
+
* `getRoutes` with `options.gasless: true`.
|
|
146
148
|
*/
|
|
147
149
|
getRelayerQuote: (
|
|
148
150
|
params: QuoteRequestFromAmount,
|
|
@@ -36,17 +36,9 @@ export const relayTransaction = async (
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
// Determine if the request is for a gasless relayer service or advanced relayer service
|
|
40
|
-
// We will use the same endpoint for both after the gasless relayer service is deprecated
|
|
41
|
-
const relayerPath = params.typedData.some(
|
|
42
|
-
(t) => t.primaryType === 'PermitWitnessTransferFrom'
|
|
43
|
-
)
|
|
44
|
-
? '/relayer/relay'
|
|
45
|
-
: '/advanced/relay'
|
|
46
|
-
|
|
47
39
|
const result = await request<RelayResponse>(
|
|
48
40
|
client.config,
|
|
49
|
-
`${client.config.apiUrl}
|
|
41
|
+
`${client.config.apiUrl}/advanced/relay`,
|
|
50
42
|
{
|
|
51
43
|
method: 'POST',
|
|
52
44
|
headers: {
|
|
@@ -3,8 +3,8 @@ import { TransactionError } from '../../errors/errors.js'
|
|
|
3
3
|
import type { StepExecutorContext, TaskResult } from '../../types/execution.js'
|
|
4
4
|
import { BaseStepExecutionTask } from '../BaseStepExecutionTask.js'
|
|
5
5
|
import {
|
|
6
|
-
type CheckBalanceOptions,
|
|
7
6
|
checkBalance,
|
|
7
|
+
type CheckBalanceOptions,
|
|
8
8
|
} from './helpers/checkBalance.js'
|
|
9
9
|
|
|
10
10
|
export class CheckBalanceTask extends BaseStepExecutionTask {
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
//
|
|
2
|
-
// biome-ignore lint/performance/noReExportAll: types
|
|
1
|
+
// oxlint-disable-next-line oxc/no-barrel-file -- module entrypoint
|
|
3
2
|
export * from '@lifi/types'
|
|
4
3
|
export { getChains } from './actions/getChains.js'
|
|
5
4
|
export { getConnections } from './actions/getConnections.js'
|
|
@@ -136,6 +135,7 @@ export { checkPackageUpdates } from './utils/checkPackageUpdates.js'
|
|
|
136
135
|
export { convertQuoteToRoute } from './utils/convertQuoteToRoute.js'
|
|
137
136
|
export { fetchTxErrorDetails } from './utils/fetchTxErrorDetails.js'
|
|
138
137
|
export { formatUnits } from './utils/formatUnits.js'
|
|
138
|
+
export { GASLESS_RELAY_FEE_NAME, isGaslessStep } from './utils/isGaslessStep.js'
|
|
139
139
|
export { isHex } from './utils/isHex.js'
|
|
140
140
|
export { LruMap } from './utils/lru.js'
|
|
141
141
|
export { parseUnits } from './utils/parseUnits.js'
|
package/src/types/core.ts
CHANGED
|
@@ -38,8 +38,9 @@ export interface SDKBaseConfig {
|
|
|
38
38
|
storage?: SDKStorage
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export interface SDKConfig
|
|
42
|
-
|
|
41
|
+
export interface SDKConfig extends Partial<
|
|
42
|
+
Omit<SDKBaseConfig, 'integrator' | 'rpcUrls'>
|
|
43
|
+
> {
|
|
43
44
|
integrator: string
|
|
44
45
|
/**
|
|
45
46
|
* Per chain, one list for reads and sends, or lists by role. The client
|
|
@@ -1,7 +1,23 @@
|
|
|
1
|
+
import { isHex } from './isHex.js'
|
|
2
|
+
|
|
3
|
+
// `0x` plus 64 hex characters: a 32-byte EVM transaction hash.
|
|
4
|
+
const TX_HASH_LENGTH = 66
|
|
5
|
+
|
|
1
6
|
export const fetchTxErrorDetails = async (
|
|
2
7
|
txHash: string,
|
|
3
8
|
chainId: number
|
|
4
9
|
): Promise<unknown> => {
|
|
10
|
+
// Both values go into the Tenderly URL path. Accept only an EVM transaction
|
|
11
|
+
// hash and a real chain ID, and send no request for anything else.
|
|
12
|
+
if (
|
|
13
|
+
!isHex(txHash) ||
|
|
14
|
+
txHash.length !== TX_HASH_LENGTH ||
|
|
15
|
+
!Number.isSafeInteger(chainId) ||
|
|
16
|
+
chainId <= 0
|
|
17
|
+
) {
|
|
18
|
+
return undefined
|
|
19
|
+
}
|
|
20
|
+
|
|
5
21
|
try {
|
|
6
22
|
const response = await fetch(
|
|
7
23
|
`https://api.tenderly.co/api/v1/public-contract/${chainId}/tx/${txHash}`
|