@lifi/sdk-provider-ethereum 0.0.0-preview-9b9526be → 0.0.0-preview-e8c80bc4

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.
Files changed (56) hide show
  1. package/CHANGELOG.md +29 -7
  2. package/dist/cjs/actions/waitForRelayedTransactionReceipt.d.ts +1 -1
  3. package/dist/cjs/actions/waitForRelayedTransactionReceipt.js +49 -10
  4. package/dist/cjs/actions/waitForRelayedTransactionReceipt.js.map +1 -1
  5. package/dist/cjs/core/tasks/EthereumCheckBalanceTask.js +1 -0
  6. package/dist/cjs/core/tasks/EthereumCheckBalanceTask.js.map +1 -1
  7. package/dist/cjs/core/tasks/EthereumPrepareTransactionTask.js +4 -2
  8. package/dist/cjs/core/tasks/EthereumPrepareTransactionTask.js.map +1 -1
  9. package/dist/cjs/core/tasks/helpers/getEthereumExecutionStrategy.js +2 -0
  10. package/dist/cjs/core/tasks/helpers/getEthereumExecutionStrategy.js.map +1 -1
  11. package/dist/cjs/core/tasks/helpers/getUpdatedStep.d.ts +10 -2
  12. package/dist/cjs/core/tasks/helpers/getUpdatedStep.js +10 -18
  13. package/dist/cjs/core/tasks/helpers/getUpdatedStep.js.map +1 -1
  14. package/dist/cjs/core/tasks/helpers/shouldCheckForAllowance.js +1 -0
  15. package/dist/cjs/core/tasks/helpers/shouldCheckForAllowance.js.map +1 -1
  16. package/dist/cjs/utils/isGaslessStep.d.ts +7 -0
  17. package/dist/cjs/utils/isGaslessStep.js +7 -0
  18. package/dist/cjs/utils/isGaslessStep.js.map +1 -1
  19. package/dist/cjs/version.d.ts +1 -1
  20. package/dist/cjs/version.js +1 -1
  21. package/dist/cjs/version.js.map +1 -1
  22. package/dist/esm/actions/waitForRelayedTransactionReceipt.d.ts +1 -1
  23. package/dist/esm/actions/waitForRelayedTransactionReceipt.d.ts.map +1 -1
  24. package/dist/esm/actions/waitForRelayedTransactionReceipt.js +50 -11
  25. package/dist/esm/actions/waitForRelayedTransactionReceipt.js.map +1 -1
  26. package/dist/esm/core/tasks/EthereumCheckBalanceTask.d.ts.map +1 -1
  27. package/dist/esm/core/tasks/EthereumCheckBalanceTask.js +2 -1
  28. package/dist/esm/core/tasks/EthereumCheckBalanceTask.js.map +1 -1
  29. package/dist/esm/core/tasks/EthereumPrepareTransactionTask.d.ts.map +1 -1
  30. package/dist/esm/core/tasks/EthereumPrepareTransactionTask.js +5 -3
  31. package/dist/esm/core/tasks/EthereumPrepareTransactionTask.js.map +1 -1
  32. package/dist/esm/core/tasks/helpers/getEthereumExecutionStrategy.js +2 -0
  33. package/dist/esm/core/tasks/helpers/getEthereumExecutionStrategy.js.map +1 -1
  34. package/dist/esm/core/tasks/helpers/getUpdatedStep.d.ts +10 -2
  35. package/dist/esm/core/tasks/helpers/getUpdatedStep.d.ts.map +1 -1
  36. package/dist/esm/core/tasks/helpers/getUpdatedStep.js +11 -19
  37. package/dist/esm/core/tasks/helpers/getUpdatedStep.js.map +1 -1
  38. package/dist/esm/core/tasks/helpers/shouldCheckForAllowance.d.ts.map +1 -1
  39. package/dist/esm/core/tasks/helpers/shouldCheckForAllowance.js +2 -1
  40. package/dist/esm/core/tasks/helpers/shouldCheckForAllowance.js.map +1 -1
  41. package/dist/esm/utils/isGaslessStep.d.ts +7 -0
  42. package/dist/esm/utils/isGaslessStep.d.ts.map +1 -1
  43. package/dist/esm/utils/isGaslessStep.js +7 -0
  44. package/dist/esm/utils/isGaslessStep.js.map +1 -1
  45. package/dist/esm/version.d.ts +1 -1
  46. package/dist/esm/version.js +1 -1
  47. package/dist/esm/version.js.map +1 -1
  48. package/package.json +2 -2
  49. package/src/actions/waitForRelayedTransactionReceipt.ts +129 -24
  50. package/src/core/tasks/EthereumCheckBalanceTask.ts +11 -1
  51. package/src/core/tasks/EthereumPrepareTransactionTask.ts +27 -2
  52. package/src/core/tasks/helpers/getEthereumExecutionStrategy.ts +8 -1
  53. package/src/core/tasks/helpers/getUpdatedStep.ts +26 -25
  54. package/src/core/tasks/helpers/shouldCheckForAllowance.ts +8 -0
  55. package/src/utils/isGaslessStep.ts +7 -0
  56. package/src/version.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -1,6 +1,28 @@
1
1
  # @lifi/sdk-provider-ethereum
2
2
 
3
- ## 0.0.0-preview-9b9526be
3
+ ## 0.0.0-preview-e8c80bc4
4
+
5
+ ### Minor Changes
6
+
7
+ - [#548](https://github.com/lifinance/sdk/pull/548) [`de384d3`](https://github.com/lifinance/sdk/commit/de384d3fffbe0f87f73f268529b8f528cf2c4a8b) Thanks [@chybisov](https://github.com/chybisov)! - Support the new LI.FI gasless flow, and stop calling the legacy gasless service.
8
+
9
+ Request a gasless route with `options.gasless: true`. The `LIFI Gasless Relay Fee` entry in `estimate.feeCosts` marks its step. The new `isGaslessStep(step)` in `@lifi/sdk` checks for this marker, and `GASLESS_RELAY_FEE_NAME` holds its name.
10
+
11
+ For a gasless step, the EVM provider now does the following:
12
+
13
+ - It executes the step through the relayer from the start.
14
+ - It does not check native gas, does not approve, and does not sign its own permit. The relayer pays the gas, and the backend handles the allowance.
15
+ - It re-quotes through `/advanced/stepTransaction` without the old typed data.
16
+ - It relays every typed-data step through `/advanced/relay`, including `PermitWitnessTransferFrom`.
17
+ - It tracks the relay on `/v1/status?taskId=`, with the same wait as other relayed steps. Other relayed steps keep `getRelayedTransactionStatus`. On a bridge route, the wait ends when the relayed source transaction has landed. A later bridge failure then does not cause a second signature. After a `FAILED` answer, the SDK reads the source receipt to find out if the source landed.
18
+ - It fails before signing when `disableMessageSigning` is set, or when the step needs an EIP-7702 authorization.
19
+
20
+ For all relayed steps, the wait now ends after five status errors in a row, not after three errors in total. A status answer resets the count. A failed request, `NOT_FOUND` and 422/1004 count as errors. The error is not final, so a resume waits for the same task and asks for no new signature.
21
+
22
+ Deprecated (still exported, so that published consumers keep building):
23
+
24
+ - `getRelayerQuote` in `@lifi/sdk` and in the client actions. The legacy relayer endpoint is shut down, so it now rejects at once with a `NotFound` error and sends no request. Use `getRoutes` with `options.gasless: true`.
25
+ - `isGaslessStep(step, chain)` in `@lifi/sdk-provider-ethereum`. It detects only the legacy typed data. Use `isGaslessStep(step)` from `@lifi/sdk`.
4
26
 
5
27
  ### Patch Changes
6
28
 
@@ -9,9 +31,9 @@
9
31
 
10
32
  - [#539](https://github.com/lifinance/sdk/pull/539) [`b80e5f4`](https://github.com/lifinance/sdk/commit/b80e5f49941190812935644c55d5c9c075bac354) Thanks [@chybisov](https://github.com/chybisov)! - Bump runtime dependencies: @lifi/types to 18.16.0, bitcoinjs-lib to 7.0.5, viem to 2.57.17, @solana/kit to 8.6.0, @stellar/stellar-sdk to 17.4.0, @mysten/sui to 2.39.1.
11
33
 
12
- - [#540](https://github.com/lifinance/sdk/pull/540) [`78c7f83`](https://github.com/lifinance/sdk/commit/78c7f838547e2bfd56eed4cffdc3ab4a9c164061) Thanks [@chybisov](https://github.com/chybisov)! - When the wallet cannot switch to the step's chain, the step now fails with `ChainSwitchError`, not `UnknownError`. wagmi connectors throw viem's `SwitchChainError` for this, for example for "Unknown Network: eip155:130" or "wallet_switchEthereumChain::chainId 0xe708 not supported". `parseEthereumErrors` runs its existing checks first. So a rejected switch still gives `SignatureRejected`, and a switch error with the code -32000 or -32603 keeps the result that it had before. A raw EIP-1193 error with code 4001 now also gives `SignatureRejected`.
34
+ - [#540](https://github.com/lifinance/sdk/pull/540) [`b44c152`](https://github.com/lifinance/sdk/commit/b44c1525f301a7b2c3dfa6ae6d7d337f3ce3847e) Thanks [@chybisov](https://github.com/chybisov)! - When the wallet cannot switch to the step's chain, the step now fails with `ChainSwitchError`, not `UnknownError`. wagmi connectors throw viem's `SwitchChainError` for this, for example for "Unknown Network: eip155:130" or "wallet_switchEthereumChain::chainId 0xe708 not supported". `parseEthereumErrors` runs its existing checks first. So a rejected switch still gives `SignatureRejected`, and a switch error with the code -32000 or -32603 keeps the result that it had before. A raw EIP-1193 error with code 4001 now also gives `SignatureRejected`.
13
35
 
14
- - [#550](https://github.com/lifinance/sdk/pull/550) [`dd2468e`](https://github.com/lifinance/sdk/commit/dd2468e9da01d2d8dd1f4e4637e3d3ba53733620) Thanks [@chybisov](https://github.com/chybisov)! - When a read through the wallet fails, the SDK reads again through a public client. That client now uses the step's chain, not `walletClient.chain`, which can be old. For `setTokenAllowance` and `revokeTokenApproval`, it uses the token's chain. This covers the allowance, permit, gas estimate and priority fee reads.
36
+ - [#540](https://github.com/lifinance/sdk/pull/540) [`b44c152`](https://github.com/lifinance/sdk/commit/b44c1525f301a7b2c3dfa6ae6d7d337f3ce3847e) Thanks [@chybisov](https://github.com/chybisov)! - When a read through the wallet fails, the SDK reads again through a public client. That client now uses the step's chain, not `walletClient.chain`, which can be old. For `setTokenAllowance` and `revokeTokenApproval`, it uses the token's chain. This covers the allowance, permit, gas estimate and priority fee reads.
15
37
 
16
38
  - [#546](https://github.com/lifinance/sdk/pull/546) [`5d236b1`](https://github.com/lifinance/sdk/commit/5d236b1cee56231db6d220af8335d48957f23b9a) Thanks [@chybisov](https://github.com/chybisov)! - Some wallets answer `eth_sendTransaction` with `null`, a value that is not hex, or a value shorter than a transaction hash. The approval, approval reset, swap and bridge steps now throw a `TransactionError` with `TransactionFailed` for this answer.
17
39
 
@@ -19,15 +41,15 @@
19
41
 
20
42
  - [#546](https://github.com/lifinance/sdk/pull/546) [`5d236b1`](https://github.com/lifinance/sdk/commit/5d236b1cee56231db6d220af8335d48957f23b9a) Thanks [@chybisov](https://github.com/chybisov)! - The approval and approval reset steps now wait for the receipt of the transaction that the Safe executes, not of the Safe signature. Before, the steps did not check the receipt of a queued Safe approval.
21
43
 
22
- - [#540](https://github.com/lifinance/sdk/pull/540) [`8269f46`](https://github.com/lifinance/sdk/commit/8269f46a24fa4075b4877d093d038a24684074b3) Thanks [@chybisov](https://github.com/chybisov)! - A batched send (`wallet_sendCalls`) and an approval or allowance reset now name the step's chain. Before, viem took the chain from `client.chain`. A connector client (for example, from wagmi `getConnectorClient` with `assertChainId: false`) can keep an old chain while the wallet is already on the step's chain. The wallet then rejected the bundle ("Chain ID must match the dApp selected network"), or viem stopped the approval with `ChainMismatchError`. `setAllowance` takes an optional `chain` as its last parameter.
44
+ - [#540](https://github.com/lifinance/sdk/pull/540) [`b44c152`](https://github.com/lifinance/sdk/commit/b44c1525f301a7b2c3dfa6ae6d7d337f3ce3847e) Thanks [@chybisov](https://github.com/chybisov)! - A batched send (`wallet_sendCalls`) and an approval or allowance reset now name the step's chain. Before, viem took the chain from `client.chain`. A connector client (for example, from wagmi `getConnectorClient` with `assertChainId: false`) can keep an old chain while the wallet is already on the step's chain. The wallet then rejected the bundle ("Chain ID must match the dApp selected network"), or viem stopped the approval with `ChainMismatchError`. `setAllowance` takes an optional `chain` as its last parameter.
23
45
 
24
- - [#550](https://github.com/lifinance/sdk/pull/550) [`dd2468e`](https://github.com/lifinance/sdk/commit/dd2468e9da01d2d8dd1f4e4637e3d3ba53733620) Thanks [@chybisov](https://github.com/chybisov)! - All sends now use one rule for the chain. When `client.chain` is the step's chain, the send keeps it. Otherwise the send uses the step's chain from the LI.FI API. This covers the main transaction, batched calls, approvals and allowance resets.
46
+ - [#540](https://github.com/lifinance/sdk/pull/540) [`b44c152`](https://github.com/lifinance/sdk/commit/b44c1525f301a7b2c3dfa6ae6d7d337f3ce3847e) Thanks [@chybisov](https://github.com/chybisov)! - All sends now use one rule for the chain. When `client.chain` is the step's chain, the send keeps it. Otherwise the send uses the step's chain from the LI.FI API. This covers the main transaction, batched calls, approvals and allowance resets.
25
47
 
26
48
  Before, the main transaction always used the API chain, which has no fee settings or serializers. So a local account lost the fee rules of its chain, for example the HyperEVM base fee multiplier. A matching `client.chain` now also keeps its custom fields and hooks, as viem does when no chain is given.
27
49
 
28
50
  `setTokenAllowance` and `revokeTokenApproval` now send on the token's chain. An old `walletClient.chain` no longer makes them fail with `ChainMismatchError`. If the wallet is really on another chain than the token, they now fail with `ChainMismatchError`. Before, they sent the approval on the wallet's chain. To find the token's chain, they read the chain list, which can load it from the API the first time.
29
- - Updated dependencies [[`b80e5f4`](https://github.com/lifinance/sdk/commit/b80e5f49941190812935644c55d5c9c075bac354)]:
30
- - @lifi/sdk@0.0.0-preview-9b9526be
51
+ - Updated dependencies [[`b80e5f4`](https://github.com/lifinance/sdk/commit/b80e5f49941190812935644c55d5c9c075bac354), [`de384d3`](https://github.com/lifinance/sdk/commit/de384d3fffbe0f87f73f268529b8f528cf2c4a8b)]:
52
+ - @lifi/sdk@0.0.0-preview-e8c80bc4
31
53
 
32
54
  ## 4.2.12
33
55
 
@@ -10,7 +10,7 @@ import { Hash } from "viem";
10
10
  * @param timeout - How long to wait for a result in milliseconds. Defaults to 24 hours.
11
11
  * @param signal - Ends the wait: no status request starts after it aborts, and the request in flight and the sleep end at once.
12
12
  * @returns The receipt of the relayed transaction.
13
- * @throws {TransactionError} If the transaction failed, was not found, or no result arrived before the timeout. Only the failed transaction is a final outcome.
13
+ * @throws {TransactionError} If the transaction failed, the status was not found after five status errors in a row, or no result arrived before the timeout. Only the failed transaction is a final outcome.
14
14
  * @throws The abort reason of `signal` once it aborts.
15
15
  */
16
16
  export declare const waitForRelayedTransactionReceipt: (client: SDKClient, taskId: Hash, step: LiFiStep, timeout?: number, signal?: AbortSignal) => Promise<WalletCallReceipt$1>;
@@ -1,7 +1,26 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_client_publicClient = require("../client/publicClient.js");
2
3
  let _lifi_sdk = require("@lifi/sdk");
4
+ let viem_actions = require("viem/actions");
5
+ let viem_utils = require("viem/utils");
3
6
  // src/actions/waitForRelayedTransactionReceipt.ts
4
7
  /**
8
+ * Status errors in a row that end the wait. A failed request, `NOT_FOUND`, the
9
+ * 422/1004 answer of a failed lookup and a source receipt that cannot be
10
+ * loaded each count; a PENDING answer resets the count, so a long relay does
11
+ * not collect errors over its whole wait.
12
+ */
13
+ const MAX_STATUS_ERRORS = 5;
14
+ /** The on-chain outcome of a source transaction, or `undefined` when its receipt cannot be loaded. */
15
+ const getSourceOutcome = async (client, chainId, hash) => {
16
+ try {
17
+ const publicClient = await require_client_publicClient.getPublicClient(client, chainId);
18
+ return (await (0, viem_utils.getAction)(publicClient, viem_actions.getTransactionReceipt, "getTransactionReceipt")({ hash })).status;
19
+ } catch {
20
+ return;
21
+ }
22
+ };
23
+ /**
5
24
  * Polls the relayer until the relayed transaction is done or has failed.
6
25
  *
7
26
  * @param client - {@link SDKClient}
@@ -10,38 +29,58 @@ let _lifi_sdk = require("@lifi/sdk");
10
29
  * @param timeout - How long to wait for a result in milliseconds. Defaults to 24 hours.
11
30
  * @param signal - Ends the wait: no status request starts after it aborts, and the request in flight and the sleep end at once.
12
31
  * @returns The receipt of the relayed transaction.
13
- * @throws {TransactionError} If the transaction failed, was not found, or no result arrived before the timeout. Only the failed transaction is a final outcome.
32
+ * @throws {TransactionError} If the transaction failed, the status was not found after five status errors in a row, or no result arrived before the timeout. Only the failed transaction is a final outcome.
14
33
  * @throws The abort reason of `signal` once it aborts.
15
34
  */
16
35
  const waitForRelayedTransactionReceipt = async (client, taskId, step, timeout = 864e5, signal) => {
17
36
  const startTime = Date.now();
37
+ const isGasless = (0, _lifi_sdk.isGaslessStep)(step);
38
+ const isCrossChain = step.action.fromChainId !== step.action.toChainId;
39
+ let statusErrors = 0;
18
40
  return (0, _lifi_sdk.waitForResult)(async () => {
19
41
  if (Date.now() - startTime > timeout) throw new _lifi_sdk.TransactionError(_lifi_sdk.LiFiErrorCode.TransactionFailed, "Relayed transaction timed out waiting for a result.");
20
- const result = await (0, _lifi_sdk.getRelayedTransactionStatus)(client, {
42
+ const result = await (isGasless ? (0, _lifi_sdk.getStatus)(client, { taskId }, { signal }) : (0, _lifi_sdk.getRelayedTransactionStatus)(client, {
21
43
  taskId,
22
44
  fromChain: step.action.fromChainId,
23
45
  toChain: step.action.toChainId,
24
46
  ...step.tool !== "custom" && { bridge: step.tool }
25
- }, { signal }).catch((e) => {
47
+ }, { signal })).catch((e) => {
26
48
  if (process.env.NODE_ENV === "development" && !signal?.aborted) console.debug("Fetching status from relayer failed.", e);
27
49
  });
50
+ const gaslessStatus = isGasless ? result : void 0;
51
+ const bridgeSource = isCrossChain && gaslessStatus?.sending?.txHash ? {
52
+ status: "success",
53
+ transactionHash: gaslessStatus.sending.txHash,
54
+ transactionLink: gaslessStatus.sending.txLink
55
+ } : void 0;
56
+ const statusError = (error) => {
57
+ statusErrors++;
58
+ if (statusErrors < MAX_STATUS_ERRORS) return;
59
+ throw error;
60
+ };
28
61
  switch (result?.status) {
29
- case "PENDING": return;
62
+ case "PENDING":
63
+ statusErrors = 0;
64
+ return gaslessStatus?.substatus === "WAIT_DESTINATION_TRANSACTION" ? bridgeSource : void 0;
30
65
  case "DONE": {
31
66
  const sending = result?.transactionStatus?.sending || result?.sending;
32
67
  return {
33
68
  status: "success",
34
69
  gasUsed: sending?.gasUsed,
35
- transactionHash: result?.metadata.txHash || sending?.txHash,
70
+ transactionHash: result?.metadata?.txHash || sending?.txHash,
36
71
  transactionLink: sending?.txLink
37
72
  };
38
73
  }
39
- case "FAILED": throw new _lifi_sdk.TransactionError(_lifi_sdk.LiFiErrorCode.TransactionFailed, "Transaction was reverted.", void 0, { final: true });
40
- default: throw new _lifi_sdk.TransactionError(_lifi_sdk.LiFiErrorCode.TransactionNotFound, "Transaction not found.");
74
+ case "FAILED":
75
+ if (bridgeSource) {
76
+ const outcome = await getSourceOutcome(client, step.action.fromChainId, bridgeSource.transactionHash);
77
+ if (outcome === "success") return bridgeSource;
78
+ if (outcome === void 0) return statusError(new _lifi_sdk.TransactionError(_lifi_sdk.LiFiErrorCode.TransactionFailed, "The relayed transaction failed, and its source transaction could not be checked."));
79
+ }
80
+ throw new _lifi_sdk.TransactionError(_lifi_sdk.LiFiErrorCode.TransactionFailed, "Transaction was reverted.", void 0, { final: true });
81
+ default: return statusError(new _lifi_sdk.TransactionError(_lifi_sdk.LiFiErrorCode.TransactionNotFound, "Transaction not found."));
41
82
  }
42
- }, 5e3, 3, (_, error) => {
43
- return !(error instanceof _lifi_sdk.TransactionError && error.code === _lifi_sdk.LiFiErrorCode.TransactionFailed);
44
- }, signal);
83
+ }, 5e3, void 0, () => false, signal);
45
84
  };
46
85
  exports.waitForRelayedTransactionReceipt = waitForRelayedTransactionReceipt;
47
86
 
@@ -1 +1 @@
1
- {"version":3,"file":"waitForRelayedTransactionReceipt.js","names":["waitForResult","TransactionError","LiFiErrorCode","getRelayedTransactionStatus"],"sources":["../../../src/actions/waitForRelayedTransactionReceipt.ts"],"sourcesContent":["import type { SDKClient } from '@lifi/sdk'\nimport {\n type ExtendedTransactionInfo,\n type FullStatusData,\n getRelayedTransactionStatus,\n LiFiErrorCode,\n type LiFiStep,\n TransactionError,\n waitForResult,\n} from '@lifi/sdk'\nimport type { Hash } from 'viem'\nimport type { WalletCallReceipt } from '../types.js'\n\n/**\n * Polls the relayer until the relayed transaction is done or has failed.\n *\n * @param client - {@link SDKClient}\n * @param taskId - The relayer task id.\n * @param step - The step the task belongs to.\n * @param timeout - How long to wait for a result in milliseconds. Defaults to 24 hours.\n * @param signal - Ends the wait: no status request starts after it aborts, and the request in flight and the sleep end at once.\n * @returns The receipt of the relayed transaction.\n * @throws {TransactionError} If the transaction failed, was not found, or no result arrived before the timeout. Only the failed transaction is a final outcome.\n * @throws The abort reason of `signal` once it aborts.\n */\nexport const waitForRelayedTransactionReceipt = async (\n client: SDKClient,\n taskId: Hash,\n step: LiFiStep,\n timeout: number = 3_600_000 * 24,\n signal?: AbortSignal\n): Promise<WalletCallReceipt> => {\n const startTime = Date.now()\n return waitForResult(\n async () => {\n // Without this check, a task that stays PENDING is polled forever:\n // PENDING is not an error, so the retry limit does not apply.\n // TransactionFailed is not retried, so this ends the poll. Not final:\n // the relayer may still execute the task, so the action keeps its task\n // id and a resume waits for it again instead of signing a new one.\n if (Date.now() - startTime > timeout) {\n throw new TransactionError(\n LiFiErrorCode.TransactionFailed,\n 'Relayed transaction timed out waiting for a result.'\n )\n }\n\n const result = await getRelayedTransactionStatus(\n client,\n {\n taskId,\n fromChain: step.action.fromChainId,\n toChain: step.action.toChainId,\n ...(step.tool !== 'custom' && { bridge: step.tool }),\n },\n { signal }\n ).catch((e) => {\n // A request that the abort ended is no failure of the relayer.\n if (process.env.NODE_ENV === 'development' && !signal?.aborted) {\n console.debug('Fetching status from relayer failed.', e)\n }\n return undefined\n })\n\n switch (result?.status) {\n case 'PENDING':\n return undefined\n case 'DONE': {\n const sending: ExtendedTransactionInfo | undefined =\n (result?.transactionStatus?.sending as ExtendedTransactionInfo) ||\n ((result as unknown as FullStatusData)\n ?.sending as ExtendedTransactionInfo)\n return {\n status: 'success',\n gasUsed: sending?.gasUsed,\n transactionHash: result?.metadata.txHash || sending?.txHash,\n transactionLink: sending?.txLink,\n } as unknown as WalletCallReceipt\n }\n case 'FAILED':\n throw new TransactionError(\n LiFiErrorCode.TransactionFailed,\n 'Transaction was reverted.',\n undefined,\n { final: true }\n )\n default:\n throw new TransactionError(\n LiFiErrorCode.TransactionNotFound,\n 'Transaction not found.'\n )\n }\n },\n 5000,\n 3,\n (_, error) => {\n return !(\n error instanceof TransactionError &&\n error.code === LiFiErrorCode.TransactionFailed\n )\n },\n signal\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAyBA,MAAa,mCAAmC,OAC9C,QACA,QACA,MACA,UAAkB,OAClB,WAC+B;CAC/B,MAAM,YAAY,KAAK,IAAI;CAC3B,QAAA,GAAOA,UAAAA,cAAAA,CACL,YAAY;EAMV,IAAI,KAAK,IAAI,IAAI,YAAY,SAC3B,MAAM,IAAIC,UAAAA,iBACRC,UAAAA,cAAc,mBACd,qDACF;EAGF,MAAM,SAAS,OAAA,GAAMC,UAAAA,4BAAAA,CACnB,QACA;GACE;GACA,WAAW,KAAK,OAAO;GACvB,SAAS,KAAK,OAAO;GACrB,GAAI,KAAK,SAAS,YAAY,EAAE,QAAQ,KAAK,KAAK;EACpD,GACA,EAAE,OAAO,CACX,CAAC,CAAC,OAAO,MAAM;GAEb,IAAI,QAAQ,IAAI,aAAa,iBAAiB,CAAC,QAAQ,SACrD,QAAQ,MAAM,wCAAwC,CAAC;EAG3D,CAAC;EAED,QAAQ,QAAQ,QAAhB;GACE,KAAK,WACH;GACF,KAAK,QAAQ;IACX,MAAM,UACH,QAAQ,mBAAmB,WAC1B,QACE;IACN,OAAO;KACL,QAAQ;KACR,SAAS,SAAS;KAClB,iBAAiB,QAAQ,SAAS,UAAU,SAAS;KACrD,iBAAiB,SAAS;IAC5B;GACF;GACA,KAAK,UACH,MAAM,IAAIF,UAAAA,iBACRC,UAAAA,cAAc,mBACd,6BACA,KAAA,GACA,EAAE,OAAO,KAAK,CAChB;GACF,SACE,MAAM,IAAID,UAAAA,iBACRC,UAAAA,cAAc,qBACd,wBACF;EACJ;CACF,GACA,KACA,IACC,GAAG,UAAU;EACZ,OAAO,EACL,iBAAiBD,UAAAA,oBACjB,MAAM,SAASC,UAAAA,cAAc;CAEjC,GACA,MACF;AACF"}
1
+ {"version":3,"file":"waitForRelayedTransactionReceipt.js","names":["getPublicClient","getAction","getTransactionReceipt","isGaslessStep","waitForResult","TransactionError","LiFiErrorCode","getStatus","getRelayedTransactionStatus"],"sources":["../../../src/actions/waitForRelayedTransactionReceipt.ts"],"sourcesContent":["import type { SDKClient } from '@lifi/sdk'\nimport {\n type ExtendedTransactionInfo,\n type FullStatusData,\n getRelayedTransactionStatus,\n getStatus,\n isGaslessStep,\n LiFiErrorCode,\n type LiFiStep,\n type RelayStatusResponseData,\n TransactionError,\n waitForResult,\n} from '@lifi/sdk'\nimport type { Hash } from 'viem'\nimport { getTransactionReceipt } from 'viem/actions'\nimport { getAction } from 'viem/utils'\nimport { getPublicClient } from '../client/publicClient.js'\nimport type { WalletCallReceipt } from '../types.js'\n\n/**\n * Status errors in a row that end the wait. A failed request, `NOT_FOUND`, the\n * 422/1004 answer of a failed lookup and a source receipt that cannot be\n * loaded each count; a PENDING answer resets the count, so a long relay does\n * not collect errors over its whole wait.\n */\nconst MAX_STATUS_ERRORS = 5\n\n/** The on-chain outcome of a source transaction, or `undefined` when its receipt cannot be loaded. */\nconst getSourceOutcome = async (\n client: SDKClient,\n chainId: number,\n hash: Hash\n): Promise<'success' | 'reverted' | undefined> => {\n try {\n const publicClient = await getPublicClient(client, chainId)\n const receipt = await getAction(\n publicClient,\n getTransactionReceipt,\n 'getTransactionReceipt'\n )({ hash })\n return receipt.status\n } catch {\n return undefined\n }\n}\n\n/**\n * Polls the relayer until the relayed transaction is done or has failed.\n *\n * @param client - {@link SDKClient}\n * @param taskId - The relayer task id.\n * @param step - The step the task belongs to.\n * @param timeout - How long to wait for a result in milliseconds. Defaults to 24 hours.\n * @param signal - Ends the wait: no status request starts after it aborts, and the request in flight and the sleep end at once.\n * @returns The receipt of the relayed transaction.\n * @throws {TransactionError} If the transaction failed, the status was not found after five status errors in a row, or no result arrived before the timeout. Only the failed transaction is a final outcome.\n * @throws The abort reason of `signal` once it aborts.\n */\nexport const waitForRelayedTransactionReceipt = async (\n client: SDKClient,\n taskId: Hash,\n step: LiFiStep,\n timeout: number = 3_600_000 * 24,\n signal?: AbortSignal\n): Promise<WalletCallReceipt> => {\n const startTime = Date.now()\n const isGasless = isGaslessStep(step)\n const isCrossChain = step.action.fromChainId !== step.action.toChainId\n let statusErrors = 0\n return waitForResult(\n async () => {\n // Without this check, a task that stays PENDING is polled forever:\n // PENDING is no status error, so the error limit does not apply. An\n // error the poll throws ends it. Not final:\n // the relayer may still execute the task, so the action keeps its task\n // id and a resume waits for it again instead of signing a new one.\n if (Date.now() - startTime > timeout) {\n throw new TransactionError(\n LiFiErrorCode.TransactionFailed,\n 'Relayed transaction timed out waiting for a result.'\n )\n }\n\n // A gasless task id is a hash like a 1inch `Order` task id, so the step\n // selects the endpoint. The task id alone routes a gasless request: a\n // `bridge` would let a proxy such as the Jumper backend answer it with\n // its own order lookup. The cast is the one `getRelayedTransactionStatus`\n // makes for the Hyperliquid answer of the same endpoint.\n const result = await (\n isGasless\n ? (getStatus(\n client,\n { taskId },\n { signal }\n ) as unknown as Promise<RelayStatusResponseData>)\n : getRelayedTransactionStatus(\n client,\n {\n taskId,\n fromChain: step.action.fromChainId,\n toChain: step.action.toChainId,\n ...(step.tool !== 'custom' && { bridge: step.tool }),\n },\n { signal }\n )\n ).catch((e) => {\n // A request that the abort ended is no failure of the relayer.\n if (process.env.NODE_ENV === 'development' && !signal?.aborted) {\n console.debug('Fetching status from relayer failed.', e)\n }\n return undefined\n })\n\n // A gasless answer is the transfer status of `/v1/status`: it reports\n // the relayed source transaction in `sending` once the relayer sent it.\n // Only a bridge transfer ends the wait at its source; on one chain the\n // relayed transaction is the whole transfer.\n const gaslessStatus = isGasless\n ? (result as unknown as FullStatusData | undefined)\n : undefined\n const bridgeSource =\n isCrossChain && gaslessStatus?.sending?.txHash\n ? ({\n status: 'success',\n transactionHash: gaslessStatus.sending.txHash,\n transactionLink: gaslessStatus.sending.txLink,\n } as unknown as WalletCallReceipt)\n : undefined\n\n const statusError = (error: TransactionError): undefined => {\n statusErrors++\n if (statusErrors < MAX_STATUS_ERRORS) {\n return undefined\n }\n throw error\n }\n\n switch (result?.status) {\n case 'PENDING':\n statusErrors = 0\n // A gasless bridge transfer whose source transaction landed waits for\n // its destination. The source wait ends here, so a later bridge\n // failure reaches the status task, not the FAILED below.\n return gaslessStatus?.substatus === 'WAIT_DESTINATION_TRANSACTION'\n ? bridgeSource\n : undefined\n case 'DONE': {\n const sending: ExtendedTransactionInfo | undefined =\n (result?.transactionStatus?.sending as ExtendedTransactionInfo) ||\n ((result as unknown as FullStatusData)\n ?.sending as ExtendedTransactionInfo)\n return {\n status: 'success',\n gasUsed: sending?.gasUsed,\n transactionHash: result?.metadata?.txHash || sending?.txHash,\n transactionLink: sending?.txLink,\n } as unknown as WalletCallReceipt\n }\n case 'FAILED':\n // FAILED with a hash is mostly a relayed source transaction that\n // reverted and moved nothing, so a resume may sign again. A bridge\n // can also fail after its source landed: the tokens left the wallet,\n // and a resume must not sign and relay a second transfer. The status\n // task follows that transfer, as for any bridge. The source receipt\n // tells the two apart.\n if (bridgeSource) {\n const outcome = await getSourceOutcome(\n client,\n step.action.fromChainId,\n bridgeSource.transactionHash\n )\n if (outcome === 'success') {\n return bridgeSource\n }\n if (outcome === undefined) {\n // The node may not have the receipt yet, so this counts as a\n // status error. Not final: a resume waits for the same task and\n // checks again.\n return statusError(\n new TransactionError(\n LiFiErrorCode.TransactionFailed,\n 'The relayed transaction failed, and its source transaction could not be checked.'\n )\n )\n }\n }\n throw new TransactionError(\n LiFiErrorCode.TransactionFailed,\n 'Transaction was reverted.',\n undefined,\n { final: true }\n )\n default:\n return statusError(\n new TransactionError(\n LiFiErrorCode.TransactionNotFound,\n 'Transaction not found.'\n )\n )\n }\n },\n 5000,\n undefined,\n // The poll counts its own status errors, so every error it throws ends\n // the wait.\n () => false,\n signal\n )\n}\n"],"mappings":";;;;;;;;;;;;AAyBA,MAAM,oBAAoB;;AAG1B,MAAM,mBAAmB,OACvB,QACA,SACA,SACgD;CAChD,IAAI;EACF,MAAM,eAAe,MAAMA,4BAAAA,gBAAgB,QAAQ,OAAO;EAM1D,QAAO,OAAA,GALeC,WAAAA,UAAAA,CACpB,cACAC,aAAAA,uBACA,uBACF,CAAC,CAAC,EAAE,KAAK,CAAC,EAAA,CACK;CACjB,QAAQ;EACN;CACF;AACF;;;;;;;;;;;;;AAcA,MAAa,mCAAmC,OAC9C,QACA,QACA,MACA,UAAkB,OAClB,WAC+B;CAC/B,MAAM,YAAY,KAAK,IAAI;CAC3B,MAAM,aAAA,GAAYC,UAAAA,cAAAA,CAAc,IAAI;CACpC,MAAM,eAAe,KAAK,OAAO,gBAAgB,KAAK,OAAO;CAC7D,IAAI,eAAe;CACnB,QAAA,GAAOC,UAAAA,cAAAA,CACL,YAAY;EAMV,IAAI,KAAK,IAAI,IAAI,YAAY,SAC3B,MAAM,IAAIC,UAAAA,iBACRC,UAAAA,cAAc,mBACd,qDACF;EAQF,MAAM,SAAS,OACb,aAAA,GACKC,UAAAA,UAAAA,CACC,QACA,EAAE,OAAO,GACT,EAAE,OAAO,CACX,KAAA,GACAC,UAAAA,4BAAAA,CACE,QACA;GACE;GACA,WAAW,KAAK,OAAO;GACvB,SAAS,KAAK,OAAO;GACrB,GAAI,KAAK,SAAS,YAAY,EAAE,QAAQ,KAAK,KAAK;EACpD,GACA,EAAE,OAAO,CACX,EAAA,CACJ,OAAO,MAAM;GAEb,IAAI,QAAQ,IAAI,aAAa,iBAAiB,CAAC,QAAQ,SACrD,QAAQ,MAAM,wCAAwC,CAAC;EAG3D,CAAC;EAMD,MAAM,gBAAgB,YACjB,SACD,KAAA;EACJ,MAAM,eACJ,gBAAgB,eAAe,SAAS,SACnC;GACC,QAAQ;GACR,iBAAiB,cAAc,QAAQ;GACvC,iBAAiB,cAAc,QAAQ;EACzC,IACA,KAAA;EAEN,MAAM,eAAe,UAAuC;GAC1D;GACA,IAAI,eAAe,mBACjB;GAEF,MAAM;EACR;EAEA,QAAQ,QAAQ,QAAhB;GACE,KAAK;IACH,eAAe;IAIf,OAAO,eAAe,cAAc,iCAChC,eACA,KAAA;GACN,KAAK,QAAQ;IACX,MAAM,UACH,QAAQ,mBAAmB,WAC1B,QACE;IACN,OAAO;KACL,QAAQ;KACR,SAAS,SAAS;KAClB,iBAAiB,QAAQ,UAAU,UAAU,SAAS;KACtD,iBAAiB,SAAS;IAC5B;GACF;GACA,KAAK;IAOH,IAAI,cAAc;KAChB,MAAM,UAAU,MAAM,iBACpB,QACA,KAAK,OAAO,aACZ,aAAa,eACf;KACA,IAAI,YAAY,WACd,OAAO;KAET,IAAI,YAAY,KAAA,GAId,OAAO,YACL,IAAIH,UAAAA,iBACFC,UAAAA,cAAc,mBACd,kFACF,CACF;IAEJ;IACA,MAAM,IAAID,UAAAA,iBACRC,UAAAA,cAAc,mBACd,6BACA,KAAA,GACA,EAAE,OAAO,KAAK,CAChB;GACF,SACE,OAAO,YACL,IAAID,UAAAA,iBACFC,UAAAA,cAAc,qBACd,wBACF,CACF;EACJ;CACF,GACA,KACA,KAAA,SAGM,OACN,MACF;AACF"}
@@ -16,6 +16,7 @@ let _lifi_sdk = require("@lifi/sdk");
16
16
  var EthereumCheckBalanceTask = class extends _lifi_sdk.CheckBalanceTask {
17
17
  async getCheckBalanceOptions(context) {
18
18
  const { client, step, fromChain } = context;
19
+ if ((0, _lifi_sdk.isGaslessStep)(step)) return { walletPaysGas: false };
19
20
  const userFundsTransaction = require_utils_getTypedDataLane.isPermit2AllowanceLane(step, fromChain);
20
21
  if (step.typedData?.length && !userFundsTransaction) return { walletPaysGas: false };
21
22
  const fromAddress = step.action.fromAddress;
@@ -1 +1 @@
1
- {"version":3,"file":"EthereumCheckBalanceTask.js","names":["CheckBalanceTask","isPermit2AllowanceLane","getAccountCode","isSmartContractWalletCode"],"sources":["../../../../src/core/tasks/EthereumCheckBalanceTask.ts"],"sourcesContent":["import { type CheckBalanceOptions, CheckBalanceTask } from '@lifi/sdk'\nimport type { Address } from 'viem'\nimport { getAccountCode } from '../../actions/getAccountCode.js'\nimport { isSmartContractWalletCode } from '../../actions/isSmartContractWallet.js'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { isPermit2AllowanceLane } from '../../utils/getTypedDataLane.js'\n\n/**\n * Skips the outer-tx gas check for steps where the wallet doesn't fund it:\n * smart-contract wallets (Safe Apps, 4337, 7579, …) where the\n * executor / bundler / paymaster pays, and typed-data steps the user does not\n * fund. Source amount and non-included native fees are still verified.\n *\n * Skip-bias is intentional: a wrong skip is caught by the wallet rejecting\n * the tx; a wrong enforce blocks a tx that would have succeeded.\n */\nexport class EthereumCheckBalanceTask extends CheckBalanceTask {\n protected override async getCheckBalanceOptions(\n context: EthereumStepExecutorContext\n ): Promise<CheckBalanceOptions> {\n const { client, step, fromChain } = context\n\n const userFundsTransaction = isPermit2AllowanceLane(step, fromChain)\n if (step.typedData?.length && !userFundsTransaction) {\n return { walletPaysGas: false }\n }\n\n // Funding wallet (NOT signer) — for Safe Apps these usually match, but\n // the balance question is about the funder. Compare with\n // `canAccountUseNativePermits`, which uses the signer.\n const fromAddress = step.action.fromAddress as Address | undefined\n if (!fromAddress) {\n return {}\n }\n\n // `step.action.fromChainId` (NOT wallet's connected chain) so cross-\n // chain / post-chain-switch flows query the chain that executes the step.\n const code = await getAccountCode({\n client,\n chainId: step.action.fromChainId,\n address: fromAddress,\n })\n\n // `code === undefined` on RPC failure → falls through to \"treat as EOA\"\n // since `isSmartContractWalletCode(undefined)` is `false` (conservative:\n // strict gas check stays on, today's behavior).\n return { walletPaysGas: !isSmartContractWalletCode(code) }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,IAAa,2BAAb,cAA8CA,UAAAA,iBAAiB;CAC7D,MAAyB,uBACvB,SAC8B;EAC9B,MAAM,EAAE,QAAQ,MAAM,cAAc;EAEpC,MAAM,uBAAuBC,+BAAAA,uBAAuB,MAAM,SAAS;EACnE,IAAI,KAAK,WAAW,UAAU,CAAC,sBAC7B,OAAO,EAAE,eAAe,MAAM;EAMhC,MAAM,cAAc,KAAK,OAAO;EAChC,IAAI,CAAC,aACH,OAAO,CAAC;EAKV,MAAM,OAAO,MAAMC,+BAAAA,eAAe;GAChC;GACA,SAAS,KAAK,OAAO;GACrB,SAAS;EACX,CAAC;EAKD,OAAO,EAAE,eAAe,CAACC,sCAAAA,0BAA0B,IAAI,EAAE;CAC3D;AACF"}
1
+ {"version":3,"file":"EthereumCheckBalanceTask.js","names":["CheckBalanceTask","isGaslessStep","isPermit2AllowanceLane","getAccountCode","isSmartContractWalletCode"],"sources":["../../../../src/core/tasks/EthereumCheckBalanceTask.ts"],"sourcesContent":["import {\n type CheckBalanceOptions,\n CheckBalanceTask,\n isGaslessStep,\n} from '@lifi/sdk'\nimport type { Address } from 'viem'\nimport { getAccountCode } from '../../actions/getAccountCode.js'\nimport { isSmartContractWalletCode } from '../../actions/isSmartContractWallet.js'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport { isPermit2AllowanceLane } from '../../utils/getTypedDataLane.js'\n\n/**\n * Skips the outer-tx gas check for steps where the wallet doesn't fund it:\n * smart-contract wallets (Safe Apps, 4337, 7579, …) where the\n * executor / bundler / paymaster pays, and typed-data steps the user does not\n * fund. Source amount and non-included native fees are still verified.\n *\n * Skip-bias is intentional: a wrong skip is caught by the wallet rejecting\n * the tx; a wrong enforce blocks a tx that would have succeeded.\n */\nexport class EthereumCheckBalanceTask extends CheckBalanceTask {\n protected override async getCheckBalanceOptions(\n context: EthereumStepExecutorContext\n ): Promise<CheckBalanceOptions> {\n const { client, step, fromChain } = context\n\n // The relayer pays the gas of a gasless step. Before prepare the step has\n // no typed data yet, so the relay fee is the only signal.\n if (isGaslessStep(step)) {\n return { walletPaysGas: false }\n }\n\n const userFundsTransaction = isPermit2AllowanceLane(step, fromChain)\n if (step.typedData?.length && !userFundsTransaction) {\n return { walletPaysGas: false }\n }\n\n // Funding wallet (NOT signer) — for Safe Apps these usually match, but\n // the balance question is about the funder. Compare with\n // `canAccountUseNativePermits`, which uses the signer.\n const fromAddress = step.action.fromAddress as Address | undefined\n if (!fromAddress) {\n return {}\n }\n\n // `step.action.fromChainId` (NOT wallet's connected chain) so cross-\n // chain / post-chain-switch flows query the chain that executes the step.\n const code = await getAccountCode({\n client,\n chainId: step.action.fromChainId,\n address: fromAddress,\n })\n\n // `code === undefined` on RPC failure → falls through to \"treat as EOA\"\n // since `isSmartContractWalletCode(undefined)` is `false` (conservative:\n // strict gas check stays on, today's behavior).\n return { walletPaysGas: !isSmartContractWalletCode(code) }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAoBA,IAAa,2BAAb,cAA8CA,UAAAA,iBAAiB;CAC7D,MAAyB,uBACvB,SAC8B;EAC9B,MAAM,EAAE,QAAQ,MAAM,cAAc;EAIpC,KAAA,GAAIC,UAAAA,cAAAA,CAAc,IAAI,GACpB,OAAO,EAAE,eAAe,MAAM;EAGhC,MAAM,uBAAuBC,+BAAAA,uBAAuB,MAAM,SAAS;EACnE,IAAI,KAAK,WAAW,UAAU,CAAC,sBAC7B,OAAO,EAAE,eAAe,MAAM;EAMhC,MAAM,cAAc,KAAK,OAAO;EAChC,IAAI,CAAC,aACH,OAAO,CAAC;EAKV,MAAM,OAAO,MAAMC,+BAAAA,eAAe;GAChC;GACA,SAAS,KAAK,OAAO;GACrB,SAAS;EACX,CAAC;EAKD,OAAO,EAAE,eAAe,CAACC,sCAAAA,0BAA0B,IAAI,EAAE;CAC3D;AACF"}
@@ -8,10 +8,12 @@ let _lifi_sdk = require("@lifi/sdk");
8
8
  // src/core/tasks/EthereumPrepareTransactionTask.ts
9
9
  var EthereumPrepareTransactionTask = class extends _lifi_sdk.BaseStepExecutionTask {
10
10
  async run(context) {
11
- const { step, client, executionOptions, statusManager, allowUserInteraction, checkClient, isBridgeExecution, signedTypedData, ethereumClient, fromChain } = context;
11
+ const { step, client, executionOptions, statusManager, allowUserInteraction, checkClient, isBridgeExecution, signedTypedData, ethereumClient, fromChain, disableMessageSigning } = context;
12
12
  if (!statusManager.findAction(step, isBridgeExecution ? "CROSS_CHAIN" : "SWAP")) throw new _lifi_sdk.TransactionError(_lifi_sdk.LiFiErrorCode.TransactionUnprepared, "Unable to prepare transaction. Action not found.");
13
+ if ((0, _lifi_sdk.isGaslessStep)(step) && disableMessageSigning) throw new _lifi_sdk.TransactionError(_lifi_sdk.LiFiErrorCode.TransactionUnprepared, "Unable to prepare transaction. A gasless step needs message signing, which is disabled.");
13
14
  const typedDataBeforePrepare = step.typedData;
14
- const updatedStep = await require_core_tasks_helpers_getUpdatedStep.getUpdatedStep(client, step, fromChain, executionOptions, signedTypedData);
15
+ const updatedStep = await require_core_tasks_helpers_getUpdatedStep.getUpdatedStep(client, step, executionOptions, signedTypedData);
16
+ if ((0, _lifi_sdk.isGaslessStep)(step) && updatedStep.authorization) throw new _lifi_sdk.TransactionError(_lifi_sdk.LiFiErrorCode.TransactionUnprepared, "Unable to prepare transaction. The gasless step needs an EIP-7702 authorization, which the relayer does not support yet.");
15
17
  const comparedStep = await (0, _lifi_sdk.stepComparison)(statusManager, step, updatedStep, allowUserInteraction, executionOptions);
16
18
  const answeredTypedData = updatedStep.typedData ?? step.typedData;
17
19
  Object.assign(step, {
@@ -1 +1 @@
1
- {"version":3,"file":"EthereumPrepareTransactionTask.js","names":["BaseStepExecutionTask","TransactionError","LiFiErrorCode","getUpdatedStep","stepComparison","preservePermit2Allowances","getEthereumExecutionStrategy","isAllowancePreparedForAnotherStrategy","ExecuteStepRetryError","STRATEGY_AFTER_PREPARE","getMaxPriorityFeePerGas"],"sources":["../../../../src/core/tasks/EthereumPrepareTransactionTask.ts"],"sourcesContent":["import {\n BaseStepExecutionTask,\n ExecuteStepRetryError,\n LiFiErrorCode,\n stepComparison,\n type TaskResult,\n TransactionError,\n type TransactionParameters,\n} from '@lifi/sdk'\nimport { getMaxPriorityFeePerGas } from '../../actions/getMaxPriorityFeePerGas.js'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport {\n getEthereumExecutionStrategy,\n STRATEGY_AFTER_PREPARE,\n} from './helpers/getEthereumExecutionStrategy.js'\nimport { getUpdatedStep } from './helpers/getUpdatedStep.js'\nimport { isAllowancePreparedForAnotherStrategy } from './helpers/isAllowancePreparedForAnotherStrategy.js'\nimport { preservePermit2Allowances } from './helpers/preservePermit2Allowances.js'\n\nexport class EthereumPrepareTransactionTask extends BaseStepExecutionTask {\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n step,\n client,\n executionOptions,\n statusManager,\n allowUserInteraction,\n checkClient,\n isBridgeExecution,\n signedTypedData,\n ethereumClient,\n fromChain,\n } = context\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 // A replay restores it, so the replay re-quotes like this attempt did.\n const typedDataBeforePrepare = step.typedData\n\n // Try to prepare a new transaction request and update the step with typed data\n const updatedStep = await getUpdatedStep(\n client,\n step,\n fromChain,\n executionOptions,\n signedTypedData\n )\n\n const comparedStep = await stepComparison(\n statusManager,\n step,\n updatedStep,\n allowUserInteraction,\n executionOptions\n )\n\n const answeredTypedData = updatedStep.typedData ?? step.typedData\n\n Object.assign(step, {\n ...comparedStep,\n execution: step.execution,\n typedData: preservePermit2Allowances(\n step,\n updatedStep.typedData,\n fromChain\n ),\n })\n\n if (!step.transactionRequest && !answeredTypedData?.length) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Transaction request is not found.'\n )\n }\n\n // Recompute execution strategy after PrepareTransaction mutates step\n const executionStrategy = await getEthereumExecutionStrategy(context, true)\n\n // The allowance tasks ran before prepare, in the strategy the step seemed\n // to have. In `batched` they only queued their work. If the re-quote moves\n // the step to a strategy that work does not fit, replay the step in the new\n // strategy (JUMEMB-102): only the batched task sends queued calls, and the\n // new strategy can need another spender. Sending the queued calls instead\n // could approve that wrong spender.\n //\n // A first run in `standard` is not replayed: its approval can already be\n // on-chain, and a signer that fails the Permit2 probe cannot use the relayed\n // lane anyway. A replay is checked again, whatever its strategy.\n const allowanceStrategy = context.executionStrategy\n const isReplay = context.retryParams !== undefined\n if (\n allowanceStrategy &&\n (allowanceStrategy === 'batched' || isReplay) &&\n (await isAllowancePreparedForAnotherStrategy(\n context,\n allowanceStrategy,\n executionStrategy\n ))\n ) {\n // `executeRoute` replays a step only once, so a second change fails it.\n if (isReplay) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n `Unable to prepare transaction. The step resolved to the ${executionStrategy} strategy after its allowance was prepared for ${allowanceStrategy}.`\n )\n }\n step.typedData = typedDataBeforePrepare\n throw new ExecuteStepRetryError(\n `The step resolved to the ${executionStrategy} strategy after its allowance was prepared for ${allowanceStrategy}; retry in that strategy`,\n { [STRATEGY_AFTER_PREPARE]: executionStrategy }\n )\n }\n\n let transactionRequest: TransactionParameters | undefined\n if (step.transactionRequest) {\n // Only fetch maxPriorityFeePerGas for local accounts\n let maxPriorityFeePerGas: bigint | undefined\n if (ethereumClient.account?.type === 'local') {\n const updatedClient = await checkClient(step)\n if (!updatedClient) {\n return { status: 'PAUSED' }\n }\n maxPriorityFeePerGas = await getMaxPriorityFeePerGas(\n client,\n updatedClient,\n fromChain.id\n )\n } else {\n maxPriorityFeePerGas = step.transactionRequest.maxPriorityFeePerGas\n ? BigInt(step.transactionRequest.maxPriorityFeePerGas)\n : undefined\n }\n transactionRequest = {\n chainId: step.transactionRequest.chainId,\n to: step.transactionRequest.to,\n from: step.transactionRequest.from,\n data: step.transactionRequest.data,\n value: step.transactionRequest.value\n ? BigInt(step.transactionRequest.value)\n : undefined,\n gas: step.transactionRequest.gasLimit\n ? BigInt(step.transactionRequest.gasLimit)\n : undefined,\n // gasPrice: step.transactionRequest.gasPrice\n // ? BigInt(step.transactionRequest.gasPrice as string)\n // : undefined,\n // maxFeePerGas: step.transactionRequest.maxFeePerGas\n // ? BigInt(step.transactionRequest.maxFeePerGas as string)\n // : undefined,\n maxPriorityFeePerGas,\n }\n }\n\n if (executionOptions?.updateTransactionRequestHook && transactionRequest) {\n const customizedTransactionRequest: TransactionParameters =\n await executionOptions.updateTransactionRequestHook({\n requestType: 'transaction',\n ...transactionRequest,\n })\n transactionRequest = {\n ...transactionRequest,\n ...customizedTransactionRequest,\n }\n }\n\n return {\n status: 'COMPLETED',\n context: { transactionRequest, executionStrategy },\n }\n }\n}\n"],"mappings":";;;;;;;;AAmBA,IAAa,iCAAb,cAAoDA,UAAAA,sBAAsB;CACxE,MAAM,IAAI,SAA2D;EACnE,MAAM,EACJ,MACA,QACA,kBACA,eACA,sBACA,aACA,mBACA,iBACA,gBACA,cACE;EAOJ,IAAI,CALW,cAAc,WAC3B,MACA,oBAAoB,gBAAgB,MAG5B,GACR,MAAM,IAAIC,UAAAA,iBACRC,UAAAA,cAAc,uBACd,kDACF;EAIF,MAAM,yBAAyB,KAAK;EAGpC,MAAM,cAAc,MAAMC,0CAAAA,eACxB,QACA,MACA,WACA,kBACA,eACF;EAEA,MAAM,eAAe,OAAA,GAAMC,UAAAA,eAAAA,CACzB,eACA,MACA,aACA,sBACA,gBACF;EAEA,MAAM,oBAAoB,YAAY,aAAa,KAAK;EAExD,OAAO,OAAO,MAAM;GAClB,GAAG;GACH,WAAW,KAAK;GAChB,WAAWC,qDAAAA,0BACT,MACA,YAAY,WACZ,SACF;EACF,CAAC;EAED,IAAI,CAAC,KAAK,sBAAsB,CAAC,mBAAmB,QAClD,MAAM,IAAIJ,UAAAA,iBACRC,UAAAA,cAAc,uBACd,kEACF;EAIF,MAAM,oBAAoB,MAAMI,wDAAAA,6BAA6B,SAAS,IAAI;EAY1E,MAAM,oBAAoB,QAAQ;EAClC,MAAM,WAAW,QAAQ,gBAAgB,KAAA;EACzC,IACE,sBACC,sBAAsB,aAAa,aACnC,MAAMC,iEAAAA,sCACL,SACA,mBACA,iBACF,GACA;GAEA,IAAI,UACF,MAAM,IAAIN,UAAAA,iBACRC,UAAAA,cAAc,uBACd,2DAA2D,kBAAkB,iDAAiD,kBAAkB,EAClJ;GAEF,KAAK,YAAY;GACjB,MAAM,IAAIM,UAAAA,sBACR,4BAA4B,kBAAkB,iDAAiD,kBAAkB,2BACjH,GAAGC,wDAAAA,yBAAyB,kBAAkB,CAChD;EACF;EAEA,IAAI;EACJ,IAAI,KAAK,oBAAoB;GAE3B,IAAI;GACJ,IAAI,eAAe,SAAS,SAAS,SAAS;IAC5C,MAAM,gBAAgB,MAAM,YAAY,IAAI;IAC5C,IAAI,CAAC,eACH,OAAO,EAAE,QAAQ,SAAS;IAE5B,uBAAuB,MAAMC,wCAAAA,wBAC3B,QACA,eACA,UAAU,EACZ;GACF,OACE,uBAAuB,KAAK,mBAAmB,uBAC3C,OAAO,KAAK,mBAAmB,oBAAoB,IACnD,KAAA;GAEN,qBAAqB;IACnB,SAAS,KAAK,mBAAmB;IACjC,IAAI,KAAK,mBAAmB;IAC5B,MAAM,KAAK,mBAAmB;IAC9B,MAAM,KAAK,mBAAmB;IAC9B,OAAO,KAAK,mBAAmB,QAC3B,OAAO,KAAK,mBAAmB,KAAK,IACpC,KAAA;IACJ,KAAK,KAAK,mBAAmB,WACzB,OAAO,KAAK,mBAAmB,QAAQ,IACvC,KAAA;IAOJ;GACF;EACF;EAEA,IAAI,kBAAkB,gCAAgC,oBAAoB;GACxE,MAAM,+BACJ,MAAM,iBAAiB,6BAA6B;IAClD,aAAa;IACb,GAAG;GACL,CAAC;GACH,qBAAqB;IACnB,GAAG;IACH,GAAG;GACL;EACF;EAEA,OAAO;GACL,QAAQ;GACR,SAAS;IAAE;IAAoB;GAAkB;EACnD;CACF;AACF"}
1
+ {"version":3,"file":"EthereumPrepareTransactionTask.js","names":["BaseStepExecutionTask","TransactionError","LiFiErrorCode","isGaslessStep","getUpdatedStep","stepComparison","preservePermit2Allowances","getEthereumExecutionStrategy","isAllowancePreparedForAnotherStrategy","ExecuteStepRetryError","STRATEGY_AFTER_PREPARE","getMaxPriorityFeePerGas"],"sources":["../../../../src/core/tasks/EthereumPrepareTransactionTask.ts"],"sourcesContent":["import {\n BaseStepExecutionTask,\n ExecuteStepRetryError,\n isGaslessStep,\n LiFiErrorCode,\n stepComparison,\n type TaskResult,\n TransactionError,\n type TransactionParameters,\n} from '@lifi/sdk'\nimport { getMaxPriorityFeePerGas } from '../../actions/getMaxPriorityFeePerGas.js'\nimport type { EthereumStepExecutorContext } from '../../types.js'\nimport {\n getEthereumExecutionStrategy,\n STRATEGY_AFTER_PREPARE,\n} from './helpers/getEthereumExecutionStrategy.js'\nimport {\n type GaslessStepFields,\n getUpdatedStep,\n} from './helpers/getUpdatedStep.js'\nimport { isAllowancePreparedForAnotherStrategy } from './helpers/isAllowancePreparedForAnotherStrategy.js'\nimport { preservePermit2Allowances } from './helpers/preservePermit2Allowances.js'\n\nexport class EthereumPrepareTransactionTask extends BaseStepExecutionTask {\n async run(context: EthereumStepExecutorContext): Promise<TaskResult> {\n const {\n step,\n client,\n executionOptions,\n statusManager,\n allowUserInteraction,\n checkClient,\n isBridgeExecution,\n signedTypedData,\n ethereumClient,\n fromChain,\n disableMessageSigning,\n } = context\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 // The relayer executes a gasless step from the user's signature, and the\n // user has no gas to send it themselves. Fail before the re-quote.\n if (isGaslessStep(step) && disableMessageSigning) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. A gasless step needs message signing, which is disabled.'\n )\n }\n\n // A replay restores it, so the replay re-quotes like this attempt did.\n const typedDataBeforePrepare = step.typedData\n\n // Try to prepare a new transaction request and update the step with typed data\n const updatedStep = await getUpdatedStep(\n client,\n step,\n executionOptions,\n signedTypedData\n )\n\n // An EIP-7702 authorization installs a delegation on an account that has\n // none. The relayer rejects it for now, so signing it would be wasted.\n if (\n isGaslessStep(step) &&\n (updatedStep as GaslessStepFields).authorization\n ) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. The gasless step needs an EIP-7702 authorization, which the relayer does not support yet.'\n )\n }\n\n const comparedStep = await stepComparison(\n statusManager,\n step,\n updatedStep,\n allowUserInteraction,\n executionOptions\n )\n\n const answeredTypedData = updatedStep.typedData ?? step.typedData\n\n Object.assign(step, {\n ...comparedStep,\n execution: step.execution,\n typedData: preservePermit2Allowances(\n step,\n updatedStep.typedData,\n fromChain\n ),\n })\n\n if (!step.transactionRequest && !answeredTypedData?.length) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Transaction request is not found.'\n )\n }\n\n // Recompute execution strategy after PrepareTransaction mutates step\n const executionStrategy = await getEthereumExecutionStrategy(context, true)\n\n // The allowance tasks ran before prepare, in the strategy the step seemed\n // to have. In `batched` they only queued their work. If the re-quote moves\n // the step to a strategy that work does not fit, replay the step in the new\n // strategy (JUMEMB-102): only the batched task sends queued calls, and the\n // new strategy can need another spender. Sending the queued calls instead\n // could approve that wrong spender.\n //\n // A first run in `standard` is not replayed: its approval can already be\n // on-chain, and a signer that fails the Permit2 probe cannot use the relayed\n // lane anyway. A replay is checked again, whatever its strategy.\n const allowanceStrategy = context.executionStrategy\n const isReplay = context.retryParams !== undefined\n if (\n allowanceStrategy &&\n (allowanceStrategy === 'batched' || isReplay) &&\n (await isAllowancePreparedForAnotherStrategy(\n context,\n allowanceStrategy,\n executionStrategy\n ))\n ) {\n // `executeRoute` replays a step only once, so a second change fails it.\n if (isReplay) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n `Unable to prepare transaction. The step resolved to the ${executionStrategy} strategy after its allowance was prepared for ${allowanceStrategy}.`\n )\n }\n step.typedData = typedDataBeforePrepare\n throw new ExecuteStepRetryError(\n `The step resolved to the ${executionStrategy} strategy after its allowance was prepared for ${allowanceStrategy}; retry in that strategy`,\n { [STRATEGY_AFTER_PREPARE]: executionStrategy }\n )\n }\n\n let transactionRequest: TransactionParameters | undefined\n if (step.transactionRequest) {\n // Only fetch maxPriorityFeePerGas for local accounts\n let maxPriorityFeePerGas: bigint | undefined\n if (ethereumClient.account?.type === 'local') {\n const updatedClient = await checkClient(step)\n if (!updatedClient) {\n return { status: 'PAUSED' }\n }\n maxPriorityFeePerGas = await getMaxPriorityFeePerGas(\n client,\n updatedClient,\n fromChain.id\n )\n } else {\n maxPriorityFeePerGas = step.transactionRequest.maxPriorityFeePerGas\n ? BigInt(step.transactionRequest.maxPriorityFeePerGas)\n : undefined\n }\n transactionRequest = {\n chainId: step.transactionRequest.chainId,\n to: step.transactionRequest.to,\n from: step.transactionRequest.from,\n data: step.transactionRequest.data,\n value: step.transactionRequest.value\n ? BigInt(step.transactionRequest.value)\n : undefined,\n gas: step.transactionRequest.gasLimit\n ? BigInt(step.transactionRequest.gasLimit)\n : undefined,\n // gasPrice: step.transactionRequest.gasPrice\n // ? BigInt(step.transactionRequest.gasPrice as string)\n // : undefined,\n // maxFeePerGas: step.transactionRequest.maxFeePerGas\n // ? BigInt(step.transactionRequest.maxFeePerGas as string)\n // : undefined,\n maxPriorityFeePerGas,\n }\n }\n\n if (executionOptions?.updateTransactionRequestHook && transactionRequest) {\n const customizedTransactionRequest: TransactionParameters =\n await executionOptions.updateTransactionRequestHook({\n requestType: 'transaction',\n ...transactionRequest,\n })\n transactionRequest = {\n ...transactionRequest,\n ...customizedTransactionRequest,\n }\n }\n\n return {\n status: 'COMPLETED',\n context: { transactionRequest, executionStrategy },\n }\n }\n}\n"],"mappings":";;;;;;;;AAuBA,IAAa,iCAAb,cAAoDA,UAAAA,sBAAsB;CACxE,MAAM,IAAI,SAA2D;EACnE,MAAM,EACJ,MACA,QACA,kBACA,eACA,sBACA,aACA,mBACA,iBACA,gBACA,WACA,0BACE;EAOJ,IAAI,CALW,cAAc,WAC3B,MACA,oBAAoB,gBAAgB,MAG5B,GACR,MAAM,IAAIC,UAAAA,iBACRC,UAAAA,cAAc,uBACd,kDACF;EAKF,KAAA,GAAIC,UAAAA,cAAAA,CAAc,IAAI,KAAK,uBACzB,MAAM,IAAIF,UAAAA,iBACRC,UAAAA,cAAc,uBACd,yFACF;EAIF,MAAM,yBAAyB,KAAK;EAGpC,MAAM,cAAc,MAAME,0CAAAA,eACxB,QACA,MACA,kBACA,eACF;EAIA,KAAA,GACED,UAAAA,cAAAA,CAAc,IAAI,KACjB,YAAkC,eAEnC,MAAM,IAAIF,UAAAA,iBACRC,UAAAA,cAAc,uBACd,0HACF;EAGF,MAAM,eAAe,OAAA,GAAMG,UAAAA,eAAAA,CACzB,eACA,MACA,aACA,sBACA,gBACF;EAEA,MAAM,oBAAoB,YAAY,aAAa,KAAK;EAExD,OAAO,OAAO,MAAM;GAClB,GAAG;GACH,WAAW,KAAK;GAChB,WAAWC,qDAAAA,0BACT,MACA,YAAY,WACZ,SACF;EACF,CAAC;EAED,IAAI,CAAC,KAAK,sBAAsB,CAAC,mBAAmB,QAClD,MAAM,IAAIL,UAAAA,iBACRC,UAAAA,cAAc,uBACd,kEACF;EAIF,MAAM,oBAAoB,MAAMK,wDAAAA,6BAA6B,SAAS,IAAI;EAY1E,MAAM,oBAAoB,QAAQ;EAClC,MAAM,WAAW,QAAQ,gBAAgB,KAAA;EACzC,IACE,sBACC,sBAAsB,aAAa,aACnC,MAAMC,iEAAAA,sCACL,SACA,mBACA,iBACF,GACA;GAEA,IAAI,UACF,MAAM,IAAIP,UAAAA,iBACRC,UAAAA,cAAc,uBACd,2DAA2D,kBAAkB,iDAAiD,kBAAkB,EAClJ;GAEF,KAAK,YAAY;GACjB,MAAM,IAAIO,UAAAA,sBACR,4BAA4B,kBAAkB,iDAAiD,kBAAkB,2BACjH,GAAGC,wDAAAA,yBAAyB,kBAAkB,CAChD;EACF;EAEA,IAAI;EACJ,IAAI,KAAK,oBAAoB;GAE3B,IAAI;GACJ,IAAI,eAAe,SAAS,SAAS,SAAS;IAC5C,MAAM,gBAAgB,MAAM,YAAY,IAAI;IAC5C,IAAI,CAAC,eACH,OAAO,EAAE,QAAQ,SAAS;IAE5B,uBAAuB,MAAMC,wCAAAA,wBAC3B,QACA,eACA,UAAU,EACZ;GACF,OACE,uBAAuB,KAAK,mBAAmB,uBAC3C,OAAO,KAAK,mBAAmB,oBAAoB,IACnD,KAAA;GAEN,qBAAqB;IACnB,SAAS,KAAK,mBAAmB;IACjC,IAAI,KAAK,mBAAmB;IAC5B,MAAM,KAAK,mBAAmB;IAC9B,MAAM,KAAK,mBAAmB;IAC9B,OAAO,KAAK,mBAAmB,QAC3B,OAAO,KAAK,mBAAmB,KAAK,IACpC,KAAA;IACJ,KAAK,KAAK,mBAAmB,WACzB,OAAO,KAAK,mBAAmB,QAAQ,IACvC,KAAA;IAOJ;GACF;EACF;EAEA,IAAI,kBAAkB,gCAAgC,oBAAoB;GACxE,MAAM,+BACJ,MAAM,iBAAiB,6BAA6B;IAClD,aAAa;IACb,GAAG;GACL,CAAC;GACH,qBAAqB;IACnB,GAAG;IACH,GAAG;GACL;EACF;EAEA,OAAO;GACL,QAAQ;GACR,SAAS;IAAE;IAAoB;GAAkB;EACnD;CACF;AACF"}
@@ -1,6 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_actions_isBatchingSupported = require("../../../actions/isBatchingSupported.js");
3
3
  const require_utils_getTypedDataLane = require("../../../utils/getTypedDataLane.js");
4
+ let _lifi_sdk = require("@lifi/sdk");
4
5
  // src/core/tasks/helpers/getEthereumExecutionStrategy.ts
5
6
  /**
6
7
  * Retry param set by `EthereumPrepareTransactionTask`: the strategy prepare
@@ -30,6 +31,7 @@ async function getEthereumExecutionStrategy(context, afterPrepare = false) {
30
31
  if (!afterPrepare && executionStrategyContext) return executionStrategyContext;
31
32
  const strategyAfterPrepare = retryParams?.[STRATEGY_AFTER_PREPARE];
32
33
  if (!afterPrepare && isTransactionMethodType(strategyAfterPrepare)) return strategyAfterPrepare;
34
+ if ((0, _lifi_sdk.isGaslessStep)(step)) return "relayed";
33
35
  const atomicityNotReady = !!retryParams?.atomicityNotReady;
34
36
  if (step.executionType === "message") return "relayed";
35
37
  if (step.typedData?.length && !require_utils_getTypedDataLane.isPermit2AllowanceLane(step, fromChain)) return "relayed";
@@ -1 +1 @@
1
- {"version":3,"file":"getEthereumExecutionStrategy.js","names":["isPermit2AllowanceLane","isBatchingSupported"],"sources":["../../../../../src/core/tasks/helpers/getEthereumExecutionStrategy.ts"],"sourcesContent":["import type { TransactionMethodType } from '@lifi/sdk'\nimport { isBatchingSupported } from '../../../actions/isBatchingSupported.js'\nimport type { EthereumStepExecutorContext } from '../../../types.js'\nimport { isPermit2AllowanceLane } from '../../../utils/getTypedDataLane.js'\n\n/**\n * Retry param set by `EthereumPrepareTransactionTask`: the strategy prepare\n * established when the allowance work done for `batched` did not fit it. The\n * replay starts in this strategy.\n */\nexport const STRATEGY_AFTER_PREPARE = 'strategyAfterPrepare'\n\n// A `Record` over the union, so a new strategy fails to compile here instead of\n// being ignored by the replay.\nconst TRANSACTION_METHOD_TYPES: Record<TransactionMethodType, true> = {\n standard: true,\n relayed: true,\n batched: true,\n}\n\nconst isTransactionMethodType = (\n value: unknown\n): value is TransactionMethodType =>\n typeof value === 'string' && Object.hasOwn(TRANSACTION_METHOD_TYPES, value)\n\n/**\n * Determines the execution strategy: 'relayed', 'batched', or 'standard'.\n * Falls back to 'standard' when EIP-5792 batching is unavailable,\n * the wallet rejected the 7702 upgrade, or the tool doesn't support it.\n *\n * `afterPrepare` marks the single call from `EthereumPrepareTransactionTask`.\n * The step has just been re-quoted, so the cached verdict is stale and, for the\n * first time, the absence of a `transactionRequest` is final rather than merely\n * not-yet-known. Both effects come from that one fact, which is why they share\n * a parameter.\n */\nexport async function getEthereumExecutionStrategy(\n context: EthereumStepExecutorContext,\n afterPrepare: boolean = false\n): Promise<TransactionMethodType> {\n const {\n step,\n checkClient,\n retryParams,\n client,\n fromChain,\n ethereumClient,\n executionStrategy: executionStrategyContext,\n } = context\n\n if (!afterPrepare && executionStrategyContext) {\n return executionStrategyContext\n }\n\n // A replay starts in the strategy its first prepare established. Prepare\n // restored the step's typed data before the replay, so nothing on the step\n // shows that strategy yet.\n const strategyAfterPrepare = retryParams?.[STRATEGY_AFTER_PREPARE]\n if (!afterPrepare && isTransactionMethodType(strategyAfterPrepare)) {\n return strategyAfterPrepare\n }\n\n const atomicityNotReady = !!retryParams?.atomicityNotReady\n // Declared by the backend. It is the only signal that reaches the allowance\n // tasks, which run before a `transactionRequest` can exist.\n if (step.executionType === 'message') {\n return 'relayed'\n }\n\n // Typed data the user does not sign for its own send: gasless, `Order`,\n // Hyperliquid. A Permit2 allowance is the one shape excluded, because its signer\n // and its sender are the same person.\n if (step.typedData?.length && !isPermit2AllowanceLane(step, fromChain)) {\n return 'relayed'\n }\n\n // After prepare, missing means never: the step carries typed data and the user\n // has nothing to send, so the relayer is the only lane that can execute it.\n // This is a derivation, not a guess — no other strategy can run such a step.\n //\n // Before prepare the same expression is unsound. A Permit2 allowance that will\n // receive its transaction from `/stepTransaction` is indistinguishable from\n // one that never will, and calling it relayed there costs the step its\n // EIP-5792 batching.\n if (afterPrepare && step.typedData?.length && !step.transactionRequest) {\n return 'relayed'\n }\n\n if (atomicityNotReady || step.tool === 'thorswap') {\n return 'standard'\n }\n\n const updatedClient = (await checkClient(step)) ?? ethereumClient\n // A re-quote changes the step, not the wallet: prepare reuses the answer the\n // allowance tasks acted on, so a late read cannot flip the strategy.\n context.batchingSupported ??= isBatchingSupported(client, {\n client: updatedClient,\n chainId: fromChain.id,\n })\n return (await context.batchingSupported) ? 'batched' : 'standard'\n}\n"],"mappings":";;;;;;;;;AAUA,MAAa,yBAAyB;AAItC,MAAM,2BAAgE;CACpE,UAAU;CACV,SAAS;CACT,SAAS;AACX;AAEA,MAAM,2BACJ,UAEA,OAAO,UAAU,YAAY,OAAO,OAAO,0BAA0B,KAAK;;;;;;;;;;;;AAa5E,eAAsB,6BACpB,SACA,eAAwB,OACQ;CAChC,MAAM,EACJ,MACA,aACA,aACA,QACA,WACA,gBACA,mBAAmB,6BACjB;CAEJ,IAAI,CAAC,gBAAgB,0BACnB,OAAO;CAMT,MAAM,uBAAuB,cAAc;CAC3C,IAAI,CAAC,gBAAgB,wBAAwB,oBAAoB,GAC/D,OAAO;CAGT,MAAM,oBAAoB,CAAC,CAAC,aAAa;CAGzC,IAAI,KAAK,kBAAkB,WACzB,OAAO;CAMT,IAAI,KAAK,WAAW,UAAU,CAACA,+BAAAA,uBAAuB,MAAM,SAAS,GACnE,OAAO;CAWT,IAAI,gBAAgB,KAAK,WAAW,UAAU,CAAC,KAAK,oBAClD,OAAO;CAGT,IAAI,qBAAqB,KAAK,SAAS,YACrC,OAAO;CAGT,MAAM,gBAAiB,MAAM,YAAY,IAAI,KAAM;CAGnD,QAAQ,sBAAsBC,oCAAAA,oBAAoB,QAAQ;EACxD,QAAQ;EACR,SAAS,UAAU;CACrB,CAAC;CACD,OAAQ,MAAM,QAAQ,oBAAqB,YAAY;AACzD"}
1
+ {"version":3,"file":"getEthereumExecutionStrategy.js","names":["isGaslessStep","isPermit2AllowanceLane","isBatchingSupported"],"sources":["../../../../../src/core/tasks/helpers/getEthereumExecutionStrategy.ts"],"sourcesContent":["import { isGaslessStep, type TransactionMethodType } from '@lifi/sdk'\nimport { isBatchingSupported } from '../../../actions/isBatchingSupported.js'\nimport type { EthereumStepExecutorContext } from '../../../types.js'\nimport { isPermit2AllowanceLane } from '../../../utils/getTypedDataLane.js'\n\n/**\n * Retry param set by `EthereumPrepareTransactionTask`: the strategy prepare\n * established when the allowance work done for `batched` did not fit it. The\n * replay starts in this strategy.\n */\nexport const STRATEGY_AFTER_PREPARE = 'strategyAfterPrepare'\n\n// A `Record` over the union, so a new strategy fails to compile here instead of\n// being ignored by the replay.\nconst TRANSACTION_METHOD_TYPES: Record<TransactionMethodType, true> = {\n standard: true,\n relayed: true,\n batched: true,\n}\n\nconst isTransactionMethodType = (\n value: unknown\n): value is TransactionMethodType =>\n typeof value === 'string' && Object.hasOwn(TRANSACTION_METHOD_TYPES, value)\n\n/**\n * Determines the execution strategy: 'relayed', 'batched', or 'standard'.\n * Falls back to 'standard' when EIP-5792 batching is unavailable,\n * the wallet rejected the 7702 upgrade, or the tool doesn't support it.\n *\n * `afterPrepare` marks the single call from `EthereumPrepareTransactionTask`.\n * The step has just been re-quoted, so the cached verdict is stale and, for the\n * first time, the absence of a `transactionRequest` is final rather than merely\n * not-yet-known. Both effects come from that one fact, which is why they share\n * a parameter.\n */\nexport async function getEthereumExecutionStrategy(\n context: EthereumStepExecutorContext,\n afterPrepare: boolean = false\n): Promise<TransactionMethodType> {\n const {\n step,\n checkClient,\n retryParams,\n client,\n fromChain,\n ethereumClient,\n executionStrategy: executionStrategyContext,\n } = context\n\n if (!afterPrepare && executionStrategyContext) {\n return executionStrategyContext\n }\n\n // A replay starts in the strategy its first prepare established. Prepare\n // restored the step's typed data before the replay, so nothing on the step\n // shows that strategy yet.\n const strategyAfterPrepare = retryParams?.[STRATEGY_AFTER_PREPARE]\n if (!afterPrepare && isTransactionMethodType(strategyAfterPrepare)) {\n return strategyAfterPrepare\n }\n\n // A gasless step only executes through the relay. Before prepare it has no\n // typed data yet, so the relay fee is the only signal.\n if (isGaslessStep(step)) {\n return 'relayed'\n }\n\n const atomicityNotReady = !!retryParams?.atomicityNotReady\n\n // Declared by the backend. It is the only signal that reaches the allowance\n // tasks, which run before a `transactionRequest` can exist.\n if (step.executionType === 'message') {\n return 'relayed'\n }\n\n // Typed data the user does not sign for its own send: gasless, `Order`,\n // Hyperliquid. A Permit2 allowance is the one shape excluded, because its signer\n // and its sender are the same person.\n if (step.typedData?.length && !isPermit2AllowanceLane(step, fromChain)) {\n return 'relayed'\n }\n\n // After prepare, missing means never: the step carries typed data and the user\n // has nothing to send, so the relayer is the only lane that can execute it.\n // This is a derivation, not a guess — no other strategy can run such a step.\n //\n // Before prepare the same expression is unsound. A Permit2 allowance that will\n // receive its transaction from `/stepTransaction` is indistinguishable from\n // one that never will, and calling it relayed there costs the step its\n // EIP-5792 batching.\n if (afterPrepare && step.typedData?.length && !step.transactionRequest) {\n return 'relayed'\n }\n\n if (atomicityNotReady || step.tool === 'thorswap') {\n return 'standard'\n }\n\n const updatedClient = (await checkClient(step)) ?? ethereumClient\n // A re-quote changes the step, not the wallet: prepare reuses the answer the\n // allowance tasks acted on, so a late read cannot flip the strategy.\n context.batchingSupported ??= isBatchingSupported(client, {\n client: updatedClient,\n chainId: fromChain.id,\n })\n return (await context.batchingSupported) ? 'batched' : 'standard'\n}\n"],"mappings":";;;;;;;;;;AAUA,MAAa,yBAAyB;AAItC,MAAM,2BAAgE;CACpE,UAAU;CACV,SAAS;CACT,SAAS;AACX;AAEA,MAAM,2BACJ,UAEA,OAAO,UAAU,YAAY,OAAO,OAAO,0BAA0B,KAAK;;;;;;;;;;;;AAa5E,eAAsB,6BACpB,SACA,eAAwB,OACQ;CAChC,MAAM,EACJ,MACA,aACA,aACA,QACA,WACA,gBACA,mBAAmB,6BACjB;CAEJ,IAAI,CAAC,gBAAgB,0BACnB,OAAO;CAMT,MAAM,uBAAuB,cAAc;CAC3C,IAAI,CAAC,gBAAgB,wBAAwB,oBAAoB,GAC/D,OAAO;CAKT,KAAA,GAAIA,UAAAA,cAAAA,CAAc,IAAI,GACpB,OAAO;CAGT,MAAM,oBAAoB,CAAC,CAAC,aAAa;CAIzC,IAAI,KAAK,kBAAkB,WACzB,OAAO;CAMT,IAAI,KAAK,WAAW,UAAU,CAACC,+BAAAA,uBAAuB,MAAM,SAAS,GACnE,OAAO;CAWT,IAAI,gBAAgB,KAAK,WAAW,UAAU,CAAC,KAAK,oBAClD,OAAO;CAGT,IAAI,qBAAqB,KAAK,SAAS,YACrC,OAAO;CAGT,MAAM,gBAAiB,MAAM,YAAY,IAAI,KAAM;CAGnD,QAAQ,sBAAsBC,oCAAAA,oBAAoB,QAAQ;EACxD,QAAQ;EACR,SAAS,UAAU;CACrB,CAAC;CACD,OAAQ,MAAM,QAAQ,oBAAqB,YAAY;AACzD"}
@@ -1,3 +1,11 @@
1
- import { ExecutionOptions, ExtendedChain, LiFiStepExtended, SDKClient, SignedTypedData } from "@lifi/sdk";
1
+ import { ExecutionOptions, LiFiStepExtended, SDKClient, SignedTypedData } from "@lifi/sdk";
2
2
  /** Re-quotes the step through the endpoint that matches how it will execute. */
3
- export declare const getUpdatedStep: (client: SDKClient, step: LiFiStepExtended, fromChain: ExtendedChain, executionOptions?: ExecutionOptions, signedTypedData?: SignedTypedData[]) => Promise<LiFiStepExtended>;
3
+ export declare const getUpdatedStep: (client: SDKClient, step: LiFiStepExtended, executionOptions?: ExecutionOptions, signedTypedData?: SignedTypedData[]) => Promise<LiFiStepExtended>;
4
+ /**
5
+ * Fields `/advanced/stepTransaction` adds to a gasless step. They are not in
6
+ * `@lifi/types` yet.
7
+ */
8
+ export type GaslessStepFields = {
9
+ expiresAt?: number;
10
+ authorization?: unknown;
11
+ };
@@ -1,13 +1,12 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_permits_constants = require("../../../permits/constants.js");
3
3
  const require_utils_isContractCallStep = require("../../../utils/isContractCallStep.js");
4
- const require_utils_isGaslessStep = require("../../../utils/isGaslessStep.js");
5
4
  let _lifi_sdk = require("@lifi/sdk");
6
5
  // src/core/tasks/helpers/getUpdatedStep.ts
7
6
  /** Re-quotes the step through the endpoint that matches how it will execute. */
8
- const getUpdatedStep = async (client, step, fromChain, executionOptions, signedTypedData) => {
7
+ const getUpdatedStep = async (client, step, executionOptions, signedTypedData) => {
9
8
  if (require_utils_isContractCallStep.isContractCallStep(step)) return getContractCallUpdatedStep(client, step, executionOptions);
10
- if (require_utils_isGaslessStep.isGaslessStep(step, fromChain)) return getRelayerUpdatedStep(client, step);
9
+ if ((0, _lifi_sdk.isGaslessStep)(step)) return getGaslessUpdatedStep(client, step);
11
10
  return getStandardUpdatedStep(client, step, signedTypedData);
12
11
  };
13
12
  const getContractCallUpdatedStep = async (client, step, executionOptions) => {
@@ -71,21 +70,14 @@ const getContractCallUpdatedStep = async (client, step, executionOptions) => {
71
70
  id: step.id
72
71
  };
73
72
  };
74
- const getRelayerUpdatedStep = async (client, step) => {
75
- return {
76
- ...await (0, _lifi_sdk.getRelayerQuote)(client, {
77
- fromChain: step.action.fromChainId,
78
- fromToken: step.action.fromToken.address,
79
- fromAddress: step.action.fromAddress,
80
- fromAmount: step.action.fromAmount,
81
- toChain: step.action.toChainId,
82
- toToken: step.action.toToken.address,
83
- slippage: step.action.slippage,
84
- toAddress: step.action.toAddress,
85
- allowBridges: [step.tool]
86
- }),
87
- id: step.id
88
- };
73
+ /**
74
+ * A gasless step is re-quoted as the routes response gave it: the backend
75
+ * rejects typed data without signatures, and it builds new typed data, a new
76
+ * deadline and new nonces for every quote anyway.
77
+ */
78
+ const getGaslessUpdatedStep = async (client, step) => {
79
+ const { typedData: _typedData, expiresAt: _expiresAt, authorization: _authorization, execution: _execution, ...restStep } = step;
80
+ return (0, _lifi_sdk.getStepTransaction)(client, restStep);
89
81
  };
90
82
  const getStandardUpdatedStep = async (client, step, signedTypedData) => {
91
83
  const filteredSignedTypedData = signedTypedData?.filter((item) => item.signature);
@@ -1 +1 @@
1
- {"version":3,"file":"getUpdatedStep.js","names":["isContractCallStep","isGaslessStep","TransactionError","LiFiErrorCode","patchContractCalls","PatcherMagicNumber","getContractCallsQuote","convertQuoteToRoute","getRelayerQuote","getStepTransaction"],"sources":["../../../../../src/core/tasks/helpers/getUpdatedStep.ts"],"sourcesContent":["import {\n convertQuoteToRoute,\n type ExecutionOptions,\n type ExtendedChain,\n getContractCallsQuote,\n getRelayerQuote,\n getStepTransaction,\n LiFiErrorCode,\n type LiFiStepExtended,\n patchContractCalls,\n type SDKClient,\n type SignedTypedData,\n TransactionError,\n} from '@lifi/sdk'\nimport { PatcherMagicNumber } from '../../../permits/constants.js'\nimport { isContractCallStep } from '../../../utils/isContractCallStep.js'\nimport { isGaslessStep } from '../../../utils/isGaslessStep.js'\n\n/** Re-quotes the step through the endpoint that matches how it will execute. */\nexport const getUpdatedStep = async (\n client: SDKClient,\n step: LiFiStepExtended,\n fromChain: ExtendedChain,\n executionOptions?: ExecutionOptions,\n signedTypedData?: SignedTypedData[]\n): Promise<LiFiStepExtended> => {\n if (isContractCallStep(step)) {\n return getContractCallUpdatedStep(client, step, executionOptions)\n }\n // Do NOT substitute `hasRelayerMessage` for `isGaslessStep`: an `Order` retry\n // would fetch a relayer quote instead of `/advanced/stepTransaction`. Pinned\n // by `re-quotes an Order step ...` in `getUpdatedStep.unit.spec.ts`.\n if (isGaslessStep(step, fromChain)) {\n return getRelayerUpdatedStep(client, step)\n }\n return getStandardUpdatedStep(client, step, signedTypedData)\n}\n\nconst getContractCallUpdatedStep = async (\n client: SDKClient,\n step: LiFiStepExtended,\n executionOptions?: ExecutionOptions\n): Promise<LiFiStepExtended> => {\n const contractCallsResult = await executionOptions?.getContractCalls?.({\n fromAddress: step.action.fromAddress!,\n fromAmount: BigInt(step.action.fromAmount),\n fromChainId: step.action.fromChainId,\n fromTokenAddress: step.action.fromToken.address,\n slippage: step.action.slippage,\n toAddress: step.action.toAddress,\n toAmount: BigInt(step.estimate.toAmount),\n toChainId: step.action.toChainId,\n toTokenAddress: step.action.toToken.address,\n })\n\n if (!contractCallsResult?.contractCalls?.length) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Contract calls are not found.'\n )\n }\n\n if (contractCallsResult.patcher) {\n const patchedContractCalls = await patchContractCalls(\n client,\n contractCallsResult.contractCalls.map((call) => ({\n chainId: step.action.toChainId,\n fromTokenAddress: call.fromTokenAddress,\n targetContractAddress: call.toContractAddress,\n callDataToPatch: call.toContractCallData,\n delegateCall: false,\n patches: [\n {\n amountToReplace: PatcherMagicNumber.toString(),\n },\n ],\n }))\n )\n\n contractCallsResult.contractCalls.forEach((call, index) => {\n call.toContractAddress = patchedContractCalls[index].target\n call.toContractCallData = patchedContractCalls[index].callData\n })\n }\n\n /**\n * Limitations of the retry logic for contract calls:\n * - denyBridges and denyExchanges are not supported\n * - allowBridges and allowExchanges are not supported\n * - fee is not supported\n * - toAmount is not supported\n */\n const contractCallQuote = await getContractCallsQuote(client, {\n fromAddress: step.action.fromAddress!,\n fromChain: step.action.fromChainId,\n fromToken: step.action.fromToken.address,\n fromAmount: step.action.fromAmount,\n toChain: step.action.toChainId,\n toToken: step.action.toToken.address,\n contractCalls: contractCallsResult.contractCalls,\n toFallbackAddress: step.action.toAddress,\n slippage: step.action.slippage,\n })\n\n contractCallQuote.action.toToken = step.action.toToken\n\n const customStep = contractCallQuote.includedSteps?.find(\n (s) => s.type === 'custom'\n )\n if (customStep && contractCallsResult?.contractTool) {\n const toolDetails = {\n key: contractCallsResult.contractTool.name,\n name: contractCallsResult.contractTool.name,\n logoURI: contractCallsResult.contractTool.logoURI,\n }\n customStep.toolDetails = toolDetails\n contractCallQuote.toolDetails = toolDetails\n }\n\n const route = convertQuoteToRoute(contractCallQuote, {\n adjustZeroOutputFromPreviousStep:\n executionOptions?.adjustZeroOutputFromPreviousStep,\n })\n\n return {\n ...route.steps[0],\n id: step.id,\n }\n}\n\nconst getRelayerUpdatedStep = async (\n client: SDKClient,\n step: LiFiStepExtended\n): Promise<LiFiStepExtended> => {\n const updatedRelayedStep = await getRelayerQuote(client, {\n fromChain: step.action.fromChainId,\n fromToken: step.action.fromToken.address,\n fromAddress: step.action.fromAddress!,\n fromAmount: step.action.fromAmount,\n toChain: step.action.toChainId,\n toToken: step.action.toToken.address,\n slippage: step.action.slippage,\n toAddress: step.action.toAddress,\n allowBridges: [step.tool],\n })\n return {\n ...updatedRelayedStep,\n id: step.id,\n }\n}\n\nconst getStandardUpdatedStep = async (\n client: SDKClient,\n step: LiFiStepExtended,\n signedTypedData?: SignedTypedData[]\n): Promise<LiFiStepExtended> => {\n const filteredSignedTypedData = signedTypedData?.filter(\n (item) => item.signature\n )\n const { typedData: _, ...restStep } = step\n const params = filteredSignedTypedData?.length\n ? { ...restStep, typedData: filteredSignedTypedData }\n : restStep\n return getStepTransaction(client, params)\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"getUpdatedStep.js","names":["isContractCallStep","isGaslessStep","TransactionError","LiFiErrorCode","patchContractCalls","PatcherMagicNumber","getContractCallsQuote","convertQuoteToRoute","getStepTransaction"],"sources":["../../../../../src/core/tasks/helpers/getUpdatedStep.ts"],"sourcesContent":["import {\n convertQuoteToRoute,\n type ExecutionOptions,\n getContractCallsQuote,\n getStepTransaction,\n isGaslessStep,\n LiFiErrorCode,\n type LiFiStepExtended,\n patchContractCalls,\n type SDKClient,\n type SignedTypedData,\n TransactionError,\n} from '@lifi/sdk'\nimport { PatcherMagicNumber } from '../../../permits/constants.js'\nimport { isContractCallStep } from '../../../utils/isContractCallStep.js'\n\n/** Re-quotes the step through the endpoint that matches how it will execute. */\nexport const getUpdatedStep = async (\n client: SDKClient,\n step: LiFiStepExtended,\n executionOptions?: ExecutionOptions,\n signedTypedData?: SignedTypedData[]\n): Promise<LiFiStepExtended> => {\n if (isContractCallStep(step)) {\n return getContractCallUpdatedStep(client, step, executionOptions)\n }\n if (isGaslessStep(step)) {\n return getGaslessUpdatedStep(client, step)\n }\n return getStandardUpdatedStep(client, step, signedTypedData)\n}\n\nconst getContractCallUpdatedStep = async (\n client: SDKClient,\n step: LiFiStepExtended,\n executionOptions?: ExecutionOptions\n): Promise<LiFiStepExtended> => {\n const contractCallsResult = await executionOptions?.getContractCalls?.({\n fromAddress: step.action.fromAddress!,\n fromAmount: BigInt(step.action.fromAmount),\n fromChainId: step.action.fromChainId,\n fromTokenAddress: step.action.fromToken.address,\n slippage: step.action.slippage,\n toAddress: step.action.toAddress,\n toAmount: BigInt(step.estimate.toAmount),\n toChainId: step.action.toChainId,\n toTokenAddress: step.action.toToken.address,\n })\n\n if (!contractCallsResult?.contractCalls?.length) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Contract calls are not found.'\n )\n }\n\n if (contractCallsResult.patcher) {\n const patchedContractCalls = await patchContractCalls(\n client,\n contractCallsResult.contractCalls.map((call) => ({\n chainId: step.action.toChainId,\n fromTokenAddress: call.fromTokenAddress,\n targetContractAddress: call.toContractAddress,\n callDataToPatch: call.toContractCallData,\n delegateCall: false,\n patches: [\n {\n amountToReplace: PatcherMagicNumber.toString(),\n },\n ],\n }))\n )\n\n contractCallsResult.contractCalls.forEach((call, index) => {\n call.toContractAddress = patchedContractCalls[index].target\n call.toContractCallData = patchedContractCalls[index].callData\n })\n }\n\n /**\n * Limitations of the retry logic for contract calls:\n * - denyBridges and denyExchanges are not supported\n * - allowBridges and allowExchanges are not supported\n * - fee is not supported\n * - toAmount is not supported\n */\n const contractCallQuote = await getContractCallsQuote(client, {\n fromAddress: step.action.fromAddress!,\n fromChain: step.action.fromChainId,\n fromToken: step.action.fromToken.address,\n fromAmount: step.action.fromAmount,\n toChain: step.action.toChainId,\n toToken: step.action.toToken.address,\n contractCalls: contractCallsResult.contractCalls,\n toFallbackAddress: step.action.toAddress,\n slippage: step.action.slippage,\n })\n\n contractCallQuote.action.toToken = step.action.toToken\n\n const customStep = contractCallQuote.includedSteps?.find(\n (s) => s.type === 'custom'\n )\n if (customStep && contractCallsResult?.contractTool) {\n const toolDetails = {\n key: contractCallsResult.contractTool.name,\n name: contractCallsResult.contractTool.name,\n logoURI: contractCallsResult.contractTool.logoURI,\n }\n customStep.toolDetails = toolDetails\n contractCallQuote.toolDetails = toolDetails\n }\n\n const route = convertQuoteToRoute(contractCallQuote, {\n adjustZeroOutputFromPreviousStep:\n executionOptions?.adjustZeroOutputFromPreviousStep,\n })\n\n return {\n ...route.steps[0],\n id: step.id,\n }\n}\n\n/**\n * Fields `/advanced/stepTransaction` adds to a gasless step. They are not in\n * `@lifi/types` yet.\n */\nexport type GaslessStepFields = {\n expiresAt?: number\n authorization?: unknown\n}\n\n/**\n * A gasless step is re-quoted as the routes response gave it: the backend\n * rejects typed data without signatures, and it builds new typed data, a new\n * deadline and new nonces for every quote anyway.\n */\nconst getGaslessUpdatedStep = async (\n client: SDKClient,\n step: LiFiStepExtended\n): Promise<LiFiStepExtended> => {\n const {\n typedData: _typedData,\n expiresAt: _expiresAt,\n authorization: _authorization,\n execution: _execution,\n ...restStep\n } = step as LiFiStepExtended & GaslessStepFields\n return getStepTransaction(client, restStep)\n}\n\nconst getStandardUpdatedStep = async (\n client: SDKClient,\n step: LiFiStepExtended,\n signedTypedData?: SignedTypedData[]\n): Promise<LiFiStepExtended> => {\n const filteredSignedTypedData = signedTypedData?.filter(\n (item) => item.signature\n )\n const { typedData: _, ...restStep } = step\n const params = filteredSignedTypedData?.length\n ? { ...restStep, typedData: filteredSignedTypedData }\n : restStep\n return getStepTransaction(client, params)\n}\n"],"mappings":"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"}
@@ -2,6 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let _lifi_sdk = require("@lifi/sdk");
3
3
  // src/core/tasks/helpers/shouldCheckForAllowance.ts
4
4
  const shouldCheckForAllowance = (step, isBridgeExecution, isFromNativeToken, statusManager) => {
5
+ if ((0, _lifi_sdk.isGaslessStep)(step)) return false;
5
6
  const exchangeActionType = isBridgeExecution ? "CROSS_CHAIN" : "SWAP";
6
7
  const swapOrBridgeAction = statusManager.findAction(step, exchangeActionType);
7
8
  return !(0, _lifi_sdk.hasOpenTransaction)(swapOrBridgeAction) && !isFromNativeToken && !!step.estimate.approvalAddress && !step.estimate.skipApproval;
@@ -1 +1 @@
1
- {"version":3,"file":"shouldCheckForAllowance.js","names":["hasOpenTransaction"],"sources":["../../../../../src/core/tasks/helpers/shouldCheckForAllowance.ts"],"sourcesContent":["import {\n hasOpenTransaction,\n type LiFiStepExtended,\n type StatusManager,\n} from '@lifi/sdk'\n\nexport const shouldCheckForAllowance = (\n step: LiFiStepExtended,\n isBridgeExecution: boolean,\n isFromNativeToken: boolean,\n statusManager: StatusManager\n): boolean => {\n const exchangeActionType = isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'\n\n const swapOrBridgeAction = statusManager.findAction(step, exchangeActionType)\n\n return (\n // No swap/bridge transaction (hash, batch/relay id or stored bytes) that may\n // still land. A FAILED action with a final outcome does not count, so the\n // allowance is checked again before the new transaction.\n !hasOpenTransaction(swapOrBridgeAction) &&\n // Token is not native (address is not zero)\n !isFromNativeToken &&\n // Approval address is required for allowance checks, but may be null in special cases (e.g. direct transfers)\n !!step.estimate.approvalAddress &&\n !step.estimate.skipApproval\n )\n}\n"],"mappings":";;;AAMA,MAAa,2BACX,MACA,mBACA,mBACA,kBACY;CACZ,MAAM,qBAAqB,oBAAoB,gBAAgB;CAE/D,MAAM,qBAAqB,cAAc,WAAW,MAAM,kBAAkB;CAE5E,OAIE,EAAA,GAACA,UAAAA,mBAAAA,CAAmB,kBAAkB,KAEtC,CAAC,qBAED,CAAC,CAAC,KAAK,SAAS,mBAChB,CAAC,KAAK,SAAS;AAEnB"}
1
+ {"version":3,"file":"shouldCheckForAllowance.js","names":["isGaslessStep","hasOpenTransaction"],"sources":["../../../../../src/core/tasks/helpers/shouldCheckForAllowance.ts"],"sourcesContent":["import {\n hasOpenTransaction,\n isGaslessStep,\n type LiFiStepExtended,\n type StatusManager,\n} from '@lifi/sdk'\n\nexport const shouldCheckForAllowance = (\n step: LiFiStepExtended,\n isBridgeExecution: boolean,\n isFromNativeToken: boolean,\n statusManager: StatusManager\n): boolean => {\n // The relayer handles the allowance of a gasless step: the backend signs it\n // in as a `Permit` companion or uses the Permit2 allowance the account has.\n // An approve or an SDK permit here would cost the user gas they do not have.\n if (isGaslessStep(step)) {\n return false\n }\n\n const exchangeActionType = isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'\n\n const swapOrBridgeAction = statusManager.findAction(step, exchangeActionType)\n\n return (\n // No swap/bridge transaction (hash, batch/relay id or stored bytes) that may\n // still land. A FAILED action with a final outcome does not count, so the\n // allowance is checked again before the new transaction.\n !hasOpenTransaction(swapOrBridgeAction) &&\n // Token is not native (address is not zero)\n !isFromNativeToken &&\n // Approval address is required for allowance checks, but may be null in special cases (e.g. direct transfers)\n !!step.estimate.approvalAddress &&\n !step.estimate.skipApproval\n )\n}\n"],"mappings":";;;AAOA,MAAa,2BACX,MACA,mBACA,mBACA,kBACY;CAIZ,KAAA,GAAIA,UAAAA,cAAAA,CAAc,IAAI,GACpB,OAAO;CAGT,MAAM,qBAAqB,oBAAoB,gBAAgB;CAE/D,MAAM,qBAAqB,cAAc,WAAW,MAAM,kBAAkB;CAE5E,OAIE,EAAA,GAACC,UAAAA,mBAAAA,CAAmB,kBAAkB,KAEtC,CAAC,qBAED,CAAC,CAAC,KAAK,SAAS,mBAChB,CAAC,KAAK,SAAS;AAEnB"}
@@ -2,4 +2,11 @@ import { RelayerStep } from "../types.js";
2
2
  import { ExtendedChain, LiFiStep, LiFiStepExtended, TypedData } from "@lifi/sdk";
3
3
  /** Whether one typed-data entry is one a relayer must sign and submit. */
4
4
  export declare function isGaslessTypedData(typedData: TypedData, chain?: ExtendedChain): boolean;
5
+ /**
6
+ * Whether the step carries typed data of the legacy gasless relayer.
7
+ *
8
+ * @deprecated The legacy gasless relayer service is shut down, and a step of
9
+ * the new gasless flow has no typed data at routes time. Use `isGaslessStep`
10
+ * from `@lifi/sdk`, which detects the relay fee.
11
+ */
5
12
  export declare function isGaslessStep(step: LiFiStepExtended | LiFiStep, chain?: ExtendedChain): step is RelayerStep;
@@ -5,6 +5,13 @@ function isGaslessTypedData(typedData, chain) {
5
5
  const spender = typedData.message?.spender;
6
6
  return typedData.primaryType === "PermitWitnessTransferFrom" || !!chain?.permit2 && typeof spender === "string" && spender.toLowerCase() === chain.permit2.toLowerCase();
7
7
  }
8
+ /**
9
+ * Whether the step carries typed data of the legacy gasless relayer.
10
+ *
11
+ * @deprecated The legacy gasless relayer service is shut down, and a step of
12
+ * the new gasless flow has no typed data at routes time. Use `isGaslessStep`
13
+ * from `@lifi/sdk`, which detects the relay fee.
14
+ */
8
15
  function isGaslessStep(step, chain) {
9
16
  return !!step.typedData?.some((typedData) => isGaslessTypedData(typedData, chain));
10
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"isGaslessStep.js","names":[],"sources":["../../../src/utils/isGaslessStep.ts"],"sourcesContent":["import type {\n ExtendedChain,\n LiFiStep,\n LiFiStepExtended,\n TypedData,\n} from '@lifi/sdk'\nimport type { RelayerStep } from '../types.js'\n\n/** Whether one typed-data entry is one a relayer must sign and submit. */\nexport function isGaslessTypedData(\n typedData: TypedData,\n chain?: ExtendedChain\n): boolean {\n const spender = typedData.message?.spender\n return (\n typedData.primaryType === 'PermitWitnessTransferFrom' ||\n (!!chain?.permit2 &&\n typeof spender === 'string' &&\n spender.toLowerCase() === chain.permit2.toLowerCase())\n )\n}\n\nexport function isGaslessStep(\n step: LiFiStepExtended | LiFiStep,\n chain?: ExtendedChain\n): step is RelayerStep {\n return !!step.typedData?.some((typedData) =>\n isGaslessTypedData(typedData, chain)\n )\n}\n"],"mappings":";;;AASA,SAAgB,mBACd,WACA,OACS;CACT,MAAM,UAAU,UAAU,SAAS;CACnC,OACE,UAAU,gBAAgB,+BACzB,CAAC,CAAC,OAAO,WACR,OAAO,YAAY,YACnB,QAAQ,YAAY,MAAM,MAAM,QAAQ,YAAY;AAE1D;AAEA,SAAgB,cACd,MACA,OACqB;CACrB,OAAO,CAAC,CAAC,KAAK,WAAW,MAAM,cAC7B,mBAAmB,WAAW,KAAK,CACrC;AACF"}
1
+ {"version":3,"file":"isGaslessStep.js","names":[],"sources":["../../../src/utils/isGaslessStep.ts"],"sourcesContent":["import type {\n ExtendedChain,\n LiFiStep,\n LiFiStepExtended,\n TypedData,\n} from '@lifi/sdk'\nimport type { RelayerStep } from '../types.js'\n\n/** Whether one typed-data entry is one a relayer must sign and submit. */\nexport function isGaslessTypedData(\n typedData: TypedData,\n chain?: ExtendedChain\n): boolean {\n const spender = typedData.message?.spender\n return (\n typedData.primaryType === 'PermitWitnessTransferFrom' ||\n (!!chain?.permit2 &&\n typeof spender === 'string' &&\n spender.toLowerCase() === chain.permit2.toLowerCase())\n )\n}\n\n/**\n * Whether the step carries typed data of the legacy gasless relayer.\n *\n * @deprecated The legacy gasless relayer service is shut down, and a step of\n * the new gasless flow has no typed data at routes time. Use `isGaslessStep`\n * from `@lifi/sdk`, which detects the relay fee.\n */\nexport function isGaslessStep(\n step: LiFiStepExtended | LiFiStep,\n chain?: ExtendedChain\n): step is RelayerStep {\n return !!step.typedData?.some((typedData) =>\n isGaslessTypedData(typedData, chain)\n )\n}\n"],"mappings":";;;AASA,SAAgB,mBACd,WACA,OACS;CACT,MAAM,UAAU,UAAU,SAAS;CACnC,OACE,UAAU,gBAAgB,+BACzB,CAAC,CAAC,OAAO,WACR,OAAO,YAAY,YACnB,QAAQ,YAAY,MAAM,MAAM,QAAQ,YAAY;AAE1D;;;;;;;;AASA,SAAgB,cACd,MACA,OACqB;CACrB,OAAO,CAAC,CAAC,KAAK,WAAW,MAAM,cAC7B,mBAAmB,WAAW,KAAK,CACrC;AACF"}
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/sdk-provider-ethereum";
2
- export declare const version = "0.0.0-preview-9b9526be";
2
+ export declare const version = "0.0.0-preview-e8c80bc4";
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  // src/version.ts
3
3
  const name = "@lifi/sdk-provider-ethereum";
4
- const version = "0.0.0-preview-9b9526be";
4
+ const version = "0.0.0-preview-e8c80bc4";
5
5
  exports.name = name;
6
6
  exports.version = version;
7
7
 
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","names":[],"sources":["../../src/version.ts"],"sourcesContent":["export const name = '@lifi/sdk-provider-ethereum'\nexport const version = '0.0.0-preview-9b9526be'\n"],"mappings":";;AAAA,MAAa,OAAO;AACpB,MAAa,UAAU"}
1
+ {"version":3,"file":"version.js","names":[],"sources":["../../src/version.ts"],"sourcesContent":["export const name = '@lifi/sdk-provider-ethereum'\nexport const version = '0.0.0-preview-e8c80bc4'\n"],"mappings":";;AAAA,MAAa,OAAO;AACpB,MAAa,UAAU"}
@@ -10,7 +10,7 @@ import { Hash } from "viem";
10
10
  * @param timeout - How long to wait for a result in milliseconds. Defaults to 24 hours.
11
11
  * @param signal - Ends the wait: no status request starts after it aborts, and the request in flight and the sleep end at once.
12
12
  * @returns The receipt of the relayed transaction.
13
- * @throws {TransactionError} If the transaction failed, was not found, or no result arrived before the timeout. Only the failed transaction is a final outcome.
13
+ * @throws {TransactionError} If the transaction failed, the status was not found after five status errors in a row, or no result arrived before the timeout. Only the failed transaction is a final outcome.
14
14
  * @throws The abort reason of `signal` once it aborts.
15
15
  */
16
16
  export declare const waitForRelayedTransactionReceipt: (client: SDKClient, taskId: Hash, step: LiFiStep, timeout?: number, signal?: AbortSignal) => Promise<WalletCallReceipt$1>;
@@ -1 +1 @@
1
- {"version":3,"file":"waitForRelayedTransactionReceipt.d.ts","names":["WalletCallReceipt"],"sources":["../../../src/actions/waitForRelayedTransactionReceipt.ts"],"mappings":";;;;;;;;;;;;;;;qBAyBa,mCACX,QAAQ,WACR,QAAQ,MACR,MAAM,UACN,kBACA,SAAS,gBACR,QAAQA"}
1
+ {"version":3,"file":"waitForRelayedTransactionReceipt.d.ts","names":["WalletCallReceipt"],"sources":["../../../src/actions/waitForRelayedTransactionReceipt.ts"],"mappings":";;;;;;;;;;;;;;;qBA0Da,mCACX,QAAQ,WACR,QAAQ,MACR,MAAM,UACN,kBACA,SAAS,gBACR,QAAQA"}