0xtrails 0.2.5 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/dist/aave.d.ts +2 -0
  2. package/dist/aave.d.ts.map +1 -1
  3. package/dist/abortController.d.ts +8 -0
  4. package/dist/abortController.d.ts.map +1 -0
  5. package/dist/{ccip-CXlshvBY.js → ccip-BMB3uDZt.js} +1 -1
  6. package/dist/config.d.ts +0 -5
  7. package/dist/config.d.ts.map +1 -1
  8. package/dist/constants.d.ts +4 -4
  9. package/dist/constants.d.ts.map +1 -1
  10. package/dist/error.d.ts +4 -1
  11. package/dist/error.d.ts.map +1 -1
  12. package/dist/fees.d.ts +19 -0
  13. package/dist/fees.d.ts.map +1 -0
  14. package/dist/{index-_QuyGrjU.js → index-QXPUrZVv.js} +48719 -50852
  15. package/dist/index.d.ts +9 -8
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +811 -784
  18. package/dist/intentReceiptMonitor.d.ts +24 -0
  19. package/dist/intentReceiptMonitor.d.ts.map +1 -0
  20. package/dist/intentReceiptPoller.d.ts +69 -0
  21. package/dist/intentReceiptPoller.d.ts.map +1 -0
  22. package/dist/intents.d.ts +15 -11
  23. package/dist/intents.d.ts.map +1 -1
  24. package/dist/morpho.d.ts +6 -5
  25. package/dist/morpho.d.ts.map +1 -1
  26. package/dist/mutations.d.ts +16 -0
  27. package/dist/mutations.d.ts.map +1 -0
  28. package/dist/preconditions.d.ts +5 -4
  29. package/dist/preconditions.d.ts.map +1 -1
  30. package/dist/prepareSend.d.ts +7 -258
  31. package/dist/prepareSend.d.ts.map +1 -1
  32. package/dist/prices.d.ts +9 -6
  33. package/dist/prices.d.ts.map +1 -1
  34. package/dist/sequenceWallet.d.ts +3 -16
  35. package/dist/sequenceWallet.d.ts.map +1 -1
  36. package/dist/tokenBalances.d.ts +17 -13
  37. package/dist/tokenBalances.d.ts.map +1 -1
  38. package/dist/trails.d.ts +24 -40
  39. package/dist/trails.d.ts.map +1 -1
  40. package/dist/transactionIntent/constants.d.ts +7 -0
  41. package/dist/transactionIntent/constants.d.ts.map +1 -0
  42. package/dist/transactionIntent/deposits/depositOrchestrator.d.ts +44 -0
  43. package/dist/transactionIntent/deposits/depositOrchestrator.d.ts.map +1 -0
  44. package/dist/transactionIntent/deposits/gaslessDeposit.d.ts +30 -0
  45. package/dist/transactionIntent/deposits/gaslessDeposit.d.ts.map +1 -0
  46. package/dist/transactionIntent/deposits/index.d.ts +4 -0
  47. package/dist/transactionIntent/deposits/index.d.ts.map +1 -0
  48. package/dist/transactionIntent/deposits/standardDeposit.d.ts +30 -0
  49. package/dist/transactionIntent/deposits/standardDeposit.d.ts.map +1 -0
  50. package/dist/transactionIntent/execution/index.d.ts +2 -0
  51. package/dist/transactionIntent/execution/index.d.ts.map +1 -0
  52. package/dist/transactionIntent/execution/transactionState.d.ts +5 -0
  53. package/dist/transactionIntent/execution/transactionState.d.ts.map +1 -0
  54. package/dist/transactionIntent/handlers/crossChain.d.ts +82 -0
  55. package/dist/transactionIntent/handlers/crossChain.d.ts.map +1 -0
  56. package/dist/transactionIntent/handlers/index.d.ts +4 -0
  57. package/dist/transactionIntent/handlers/index.d.ts.map +1 -0
  58. package/dist/transactionIntent/handlers/sameChainDifferentToken.d.ts +62 -0
  59. package/dist/transactionIntent/handlers/sameChainDifferentToken.d.ts.map +1 -0
  60. package/dist/transactionIntent/handlers/sameChainSameToken.d.ts +72 -0
  61. package/dist/transactionIntent/handlers/sameChainSameToken.d.ts.map +1 -0
  62. package/dist/transactionIntent/index.d.ts +9 -0
  63. package/dist/transactionIntent/index.d.ts.map +1 -0
  64. package/dist/transactionIntent/quote/feeExtractors.d.ts +17 -0
  65. package/dist/transactionIntent/quote/feeExtractors.d.ts.map +1 -0
  66. package/dist/transactionIntent/quote/index.d.ts +4 -0
  67. package/dist/transactionIntent/quote/index.d.ts.map +1 -0
  68. package/dist/transactionIntent/quote/normalizeQuote.d.ts +34 -0
  69. package/dist/transactionIntent/quote/normalizeQuote.d.ts.map +1 -0
  70. package/dist/transactionIntent/quote/quoteHelpers.d.ts +5 -0
  71. package/dist/transactionIntent/quote/quoteHelpers.d.ts.map +1 -0
  72. package/dist/transactionIntent/types.d.ts +131 -0
  73. package/dist/transactionIntent/types.d.ts.map +1 -0
  74. package/dist/transactionIntent/utils/balanceChecker.d.ts +18 -0
  75. package/dist/transactionIntent/utils/balanceChecker.d.ts.map +1 -0
  76. package/dist/transactionIntent/utils/index.d.ts +4 -0
  77. package/dist/transactionIntent/utils/index.d.ts.map +1 -0
  78. package/dist/transactionIntent/utils/lifiHelpers.d.ts +10 -0
  79. package/dist/transactionIntent/utils/lifiHelpers.d.ts.map +1 -0
  80. package/dist/transactionIntent/utils/testnetHelpers.d.ts +3 -0
  81. package/dist/transactionIntent/utils/testnetHelpers.d.ts.map +1 -0
  82. package/dist/transactionIntent/validators.d.ts +6 -0
  83. package/dist/transactionIntent/validators.d.ts.map +1 -0
  84. package/dist/transactions.d.ts +6 -3
  85. package/dist/transactions.d.ts.map +1 -1
  86. package/dist/widget/components/AccountIntentTransactionHistoryButton.d.ts +4 -0
  87. package/dist/widget/components/AccountIntentTransactionHistoryButton.d.ts.map +1 -0
  88. package/dist/widget/components/AccountSettings.d.ts.map +1 -1
  89. package/dist/widget/components/ChainFilterDropdown.d.ts.map +1 -1
  90. package/dist/widget/components/ClassicSwap.d.ts +2 -3
  91. package/dist/widget/components/ClassicSwap.d.ts.map +1 -1
  92. package/dist/widget/components/ConfigDisplay.d.ts.map +1 -1
  93. package/dist/widget/components/ConnectWallet.d.ts.map +1 -1
  94. package/dist/widget/components/ConnectedWallets.d.ts.map +1 -1
  95. package/dist/widget/components/DynamicInputStyles.d.ts +18 -0
  96. package/dist/widget/components/DynamicInputStyles.d.ts.map +1 -0
  97. package/dist/widget/components/DynamicSizeInputField.d.ts +13 -0
  98. package/dist/widget/components/DynamicSizeInputField.d.ts.map +1 -0
  99. package/dist/widget/components/Earn.d.ts +2 -3
  100. package/dist/widget/components/Earn.d.ts.map +1 -1
  101. package/dist/widget/components/ErrorAnimationIcon.d.ts +2 -0
  102. package/dist/widget/components/ErrorAnimationIcon.d.ts.map +1 -0
  103. package/dist/widget/components/FeeBreakdown.d.ts +9 -0
  104. package/dist/widget/components/FeeBreakdown.d.ts.map +1 -0
  105. package/dist/widget/components/FeeOptions.d.ts +5 -13
  106. package/dist/widget/components/FeeOptions.d.ts.map +1 -1
  107. package/dist/widget/components/Fund.d.ts +2 -3
  108. package/dist/widget/components/Fund.d.ts.map +1 -1
  109. package/dist/widget/components/FundMethods.d.ts.map +1 -1
  110. package/dist/widget/components/FundSwap.d.ts +2 -3
  111. package/dist/widget/components/FundSwap.d.ts.map +1 -1
  112. package/dist/widget/components/FundingMethodSelectorButton.d.ts.map +1 -1
  113. package/dist/widget/components/Identicon.d.ts.map +1 -1
  114. package/dist/widget/components/MeshConnectExchanges.d.ts +0 -3
  115. package/dist/widget/components/MeshConnectExchanges.d.ts.map +1 -1
  116. package/dist/widget/components/Modal.d.ts.map +1 -1
  117. package/dist/widget/components/Pay.d.ts +2 -3
  118. package/dist/widget/components/Pay.d.ts.map +1 -1
  119. package/dist/widget/components/PoolDeposit.d.ts +3 -3
  120. package/dist/widget/components/PoolDeposit.d.ts.map +1 -1
  121. package/dist/widget/components/PoolWithdraw.d.ts +3 -20
  122. package/dist/widget/components/PoolWithdraw.d.ts.map +1 -1
  123. package/dist/widget/components/QuoteDetails.d.ts +2 -0
  124. package/dist/widget/components/QuoteDetails.d.ts.map +1 -1
  125. package/dist/widget/components/Receipt.d.ts.map +1 -1
  126. package/dist/widget/components/RecipientSelectorButton.d.ts.map +1 -1
  127. package/dist/widget/components/ScreenHeader.d.ts.map +1 -1
  128. package/dist/widget/components/Swap.d.ts +2 -3
  129. package/dist/widget/components/Swap.d.ts.map +1 -1
  130. package/dist/widget/components/ThemeProvider.d.ts.map +1 -1
  131. package/dist/widget/components/TokenDisplayNonSelectable.d.ts +11 -0
  132. package/dist/widget/components/TokenDisplayNonSelectable.d.ts.map +1 -0
  133. package/dist/widget/components/TokenSelector.d.ts.map +1 -1
  134. package/dist/widget/components/TokenSelectorButton.d.ts.map +1 -1
  135. package/dist/widget/components/Tooltip.d.ts +9 -0
  136. package/dist/widget/components/Tooltip.d.ts.map +1 -0
  137. package/dist/widget/components/TransferPendingVertical.d.ts.map +1 -1
  138. package/dist/widget/components/WaasFeeOptions.d.ts +1 -0
  139. package/dist/widget/components/WaasFeeOptions.d.ts.map +1 -1
  140. package/dist/widget/components/WalletConfirmation.d.ts.map +1 -1
  141. package/dist/widget/components/WalletConnect.d.ts.map +1 -1
  142. package/dist/widget/css/compiled.css +2 -2
  143. package/dist/widget/hooks/useCheckout.d.ts +17 -4
  144. package/dist/widget/hooks/useCheckout.d.ts.map +1 -1
  145. package/dist/widget/hooks/useDefaultTokenSelection.d.ts.map +1 -1
  146. package/dist/widget/hooks/useQuote.d.ts +82 -0
  147. package/dist/widget/hooks/useQuote.d.ts.map +1 -0
  148. package/dist/widget/hooks/useSelectedFeeToken.d.ts +1 -0
  149. package/dist/widget/hooks/useSelectedFeeToken.d.ts.map +1 -1
  150. package/dist/widget/hooks/useSendForm.d.ts +5 -6
  151. package/dist/widget/hooks/useSendForm.d.ts.map +1 -1
  152. package/dist/widget/hooks/useTokenList.d.ts.map +1 -1
  153. package/dist/widget/hooks/useWalletConnectionContext.d.ts +25 -0
  154. package/dist/widget/hooks/useWalletConnectionContext.d.ts.map +1 -0
  155. package/dist/widget/index.js +2 -2
  156. package/dist/widget/widget.d.ts +17 -7
  157. package/dist/widget/widget.d.ts.map +1 -1
  158. package/package.json +19 -21
  159. package/src/aave.ts +54 -1
  160. package/src/abortController.ts +35 -0
  161. package/src/config.ts +57 -58
  162. package/src/constants.ts +11 -9
  163. package/src/error.ts +21 -3
  164. package/src/fees.ts +210 -0
  165. package/src/index.ts +35 -13
  166. package/src/intentReceiptMonitor.ts +102 -0
  167. package/src/intentReceiptPoller.ts +299 -0
  168. package/src/intents.ts +205 -171
  169. package/src/morpho.ts +58 -9
  170. package/src/mutations.ts +129 -0
  171. package/src/preconditions.ts +16 -21
  172. package/src/prepareSend.ts +92 -4699
  173. package/src/prices.ts +26 -22
  174. package/src/relaySdk.ts +2 -2
  175. package/src/sequenceWallet.ts +6 -73
  176. package/src/tokenBalances.ts +175 -69
  177. package/src/trails.ts +230 -722
  178. package/src/transactionIntent/constants.ts +11 -0
  179. package/src/transactionIntent/deposits/depositOrchestrator.ts +210 -0
  180. package/src/transactionIntent/deposits/gaslessDeposit.ts +588 -0
  181. package/src/transactionIntent/deposits/index.ts +3 -0
  182. package/src/transactionIntent/deposits/standardDeposit.ts +379 -0
  183. package/src/transactionIntent/execution/index.ts +1 -0
  184. package/src/transactionIntent/execution/transactionState.ts +35 -0
  185. package/src/transactionIntent/handlers/crossChain.ts +1707 -0
  186. package/src/transactionIntent/handlers/index.ts +3 -0
  187. package/src/transactionIntent/handlers/sameChainDifferentToken.ts +323 -0
  188. package/src/transactionIntent/handlers/sameChainSameToken.ts +712 -0
  189. package/src/transactionIntent/index.ts +9 -0
  190. package/src/transactionIntent/quote/feeExtractors.ts +81 -0
  191. package/src/transactionIntent/quote/index.ts +3 -0
  192. package/src/transactionIntent/quote/normalizeQuote.ts +367 -0
  193. package/src/transactionIntent/quote/quoteHelpers.ts +53 -0
  194. package/src/transactionIntent/types.ts +157 -0
  195. package/src/transactionIntent/utils/balanceChecker.ts +96 -0
  196. package/src/transactionIntent/utils/index.ts +3 -0
  197. package/src/transactionIntent/utils/lifiHelpers.ts +68 -0
  198. package/src/transactionIntent/utils/testnetHelpers.ts +10 -0
  199. package/src/transactionIntent/validators.ts +57 -0
  200. package/src/transactions.ts +98 -71
  201. package/src/widget/compiled.css +2 -2
  202. package/src/widget/components/AccountIntentTransactionHistory.tsx +36 -36
  203. package/src/widget/components/AccountIntentTransactionHistoryButton.tsx +22 -0
  204. package/src/widget/components/AccountSettings.tsx +70 -41
  205. package/src/widget/components/ChainFilterDropdown.tsx +24 -3
  206. package/src/widget/components/ClassicSwap.tsx +44 -107
  207. package/src/widget/components/ConfigDisplay.tsx +0 -11
  208. package/src/widget/components/ConnectWallet.tsx +4 -1
  209. package/src/widget/components/ConnectedWallets.tsx +51 -25
  210. package/src/widget/components/DynamicInputStyles.tsx +76 -0
  211. package/src/widget/components/DynamicSizeInputField.tsx +109 -0
  212. package/src/widget/components/Earn.tsx +34 -45
  213. package/src/widget/components/ErrorAnimationIcon.tsx +130 -0
  214. package/src/widget/components/FeeBreakdown.tsx +155 -0
  215. package/src/widget/components/FeeOption.tsx +2 -2
  216. package/src/widget/components/FeeOptions.tsx +151 -112
  217. package/src/widget/components/Fund.tsx +10 -29
  218. package/src/widget/components/FundMethods.tsx +4 -3
  219. package/src/widget/components/FundSwap.tsx +2 -3
  220. package/src/widget/components/FundingMethodSelectorButton.tsx +24 -14
  221. package/src/widget/components/Identicon.tsx +164 -95
  222. package/src/widget/components/MeshConnectExchanges.tsx +2 -15
  223. package/src/widget/components/Modal.tsx +0 -12
  224. package/src/widget/components/Pay.tsx +72 -75
  225. package/src/widget/components/PoolDeposit.tsx +221 -242
  226. package/src/widget/components/PoolWithdraw.tsx +347 -469
  227. package/src/widget/components/PriceImpactWarning.tsx +1 -1
  228. package/src/widget/components/QuoteDetails.tsx +906 -484
  229. package/src/widget/components/Receipt.tsx +16 -2
  230. package/src/widget/components/RecipientSelectorButton.tsx +7 -5
  231. package/src/widget/components/Recipients.tsx +1 -1
  232. package/src/widget/components/ScreenHeader.tsx +60 -36
  233. package/src/widget/components/Swap.tsx +2 -3
  234. package/src/widget/components/ThemeProvider.tsx +2 -1
  235. package/src/widget/components/TokenDisplayNonSelectable.tsx +40 -0
  236. package/src/widget/components/TokenImage.tsx +1 -1
  237. package/src/widget/components/TokenSelector.tsx +62 -53
  238. package/src/widget/components/TokenSelectorButton.tsx +38 -15
  239. package/src/widget/components/Tooltip.tsx +51 -0
  240. package/src/widget/components/TransferPendingVertical.tsx +12 -8
  241. package/src/widget/components/WaasFeeOptions.tsx +139 -4
  242. package/src/widget/components/WalletConfirmation.tsx +23 -13
  243. package/src/widget/components/WalletConnect.tsx +93 -29
  244. package/src/widget/hooks/useAmountUsd.ts +9 -9
  245. package/src/widget/hooks/useCheckout.ts +97 -9
  246. package/src/widget/hooks/useDefaultTokenSelection.tsx +27 -21
  247. package/src/widget/hooks/useQuote.ts +466 -0
  248. package/src/widget/hooks/useSelectedFeeToken.tsx +32 -37
  249. package/src/widget/hooks/useSendForm.ts +45 -51
  250. package/src/widget/hooks/useTokenList.ts +34 -26
  251. package/src/widget/hooks/useWalletConnectionContext.tsx +128 -0
  252. package/src/widget/widget.tsx +365 -390
  253. package/dist/apiClient.d.ts +0 -9
  254. package/dist/apiClient.d.ts.map +0 -1
  255. package/dist/intentEntrypoint.d.ts +0 -114
  256. package/dist/intentEntrypoint.d.ts.map +0 -1
  257. package/dist/metaTxnMonitor.d.ts +0 -15
  258. package/dist/metaTxnMonitor.d.ts.map +0 -1
  259. package/dist/metaTxns.d.ts +0 -11
  260. package/dist/metaTxns.d.ts.map +0 -1
  261. package/dist/relayer.d.ts +0 -43
  262. package/dist/relayer.d.ts.map +0 -1
  263. package/src/apiClient.ts +0 -35
  264. package/src/intentEntrypoint.ts +0 -203
  265. package/src/metaTxnMonitor.ts +0 -171
  266. package/src/metaTxns.ts +0 -45
  267. package/src/relayer.ts +0 -289
package/src/trails.ts CHANGED
@@ -1,21 +1,19 @@
1
1
  import type {
2
- AddressOverrides,
3
- GetIntentCallsPayloadsArgs,
4
- GetIntentConfigReturn,
5
- IntentCallsPayload,
6
- IntentPrecondition,
2
+ TransactionPrecondition,
3
+ Intent,
4
+ QuoteIntentRequest,
5
+ MetaTxn,
6
+ IntentCalls,
7
7
  } from "@0xsequence/trails-api"
8
8
  import type { TrailsClient } from "./trailsClient.js"
9
- import type { RelayerOperationStatus } from "./relayer.js"
10
9
  import { useMutation, useQuery } from "@tanstack/react-query"
11
10
  import { Address } from "ox"
12
- import { useCallback, useEffect, useMemo, useRef, useState } from "react"
11
+ import { useCallback, useEffect, useState } from "react"
13
12
  import type { Hex } from "viem"
14
13
  import {
15
- createPublicClient,
16
14
  createWalletClient,
17
15
  custom,
18
- http,
16
+ ethAddress,
19
17
  isAddress,
20
18
  isAddressEqual,
21
19
  zeroAddress,
@@ -32,23 +30,23 @@ import { attemptSwitchChain } from "./chainSwitch.js"
32
30
  import { getChainInfo } from "./chains.js"
33
31
  import { getERC20TransferData } from "./encoders.js"
34
32
  import type {
35
- GetIntentCallsPayloadsReturn,
36
33
  OriginCallParams,
37
- QuoteProvider,
38
- TrailsFee,
34
+ TrailsFee as LocalTrailsFee,
39
35
  } from "./intents.js"
40
36
  import {
41
37
  calculateIntentAddress,
42
38
  calculateOriginAndDestinationIntentAddresses,
43
- getIntentCallsPayloads as getIntentCallsPayloadsFromIntents,
39
+ getIntent as getIntentFromIntents,
44
40
  } from "./intents.js"
45
- import type { MetaTxn } from "./metaTxnMonitor.js"
46
- import { useMetaTxnsMonitor } from "./metaTxnMonitor.js"
41
+ import {
42
+ useIntentReceiptMonitor,
43
+ type IntentReceiptStatus,
44
+ } from "./intentReceiptMonitor.js"
47
45
  import { findPreconditionAddresses } from "./preconditions.js"
48
- import { getBackupRelayer, useRelayers } from "./relayer.js"
49
46
  import { queueCCTPTransfer } from "./cctpqueue.js"
50
47
  import { logger } from "./logger.js"
51
- import { SEQUENCE_V3_CONTRACT_ADDRESSES_OVERRIDES } from "./constants.js"
48
+ import { useCommitIntent, useExecuteIntent } from "./mutations.js"
49
+ // Removed: import { SEQUENCE_V3_CONTRACT_ADDRESSES_OVERRIDES } from "./constants.js"
52
50
 
53
51
  export type WagmiAccount = {
54
52
  address: `0x${string}`
@@ -60,18 +58,15 @@ export type WagmiAccount = {
60
58
  export type UseTrailsConfig = {
61
59
  account: WagmiAccount
62
60
  disableAutoExecute?: boolean
63
- env: "local" | "cors-anywhere" | "dev" | "prod"
64
61
  sequenceProjectAccessKey?: string
65
62
  }
66
63
 
67
64
  export type UseTrailsReturn = {
68
65
  trailsClient: TrailsClient
69
- metaTxns: GetIntentCallsPayloadsReturn["payloads"]["metaTxns"] | null
70
- intentCallsPayloads: GetIntentCallsPayloadsReturn["payloads"]["calls"] | null
71
- intentPreconditions:
72
- | GetIntentCallsPayloadsReturn["payloads"]["preconditions"]
73
- | null
74
- trailsFee: TrailsFee | null
66
+ metaTxns: MetaTxn[] | null
67
+ intentCallsPayloads: IntentCalls[] | null
68
+ intentPreconditions: TransactionPrecondition[] | null
69
+ trailsFee: LocalTrailsFee | null
75
70
  txnHash: Hex | undefined
76
71
  committedOriginIntentAddress: string | null
77
72
  committedDestinationIntentAddress: string | null
@@ -82,39 +77,29 @@ export type UseTrailsReturn = {
82
77
  receivedOriginAddress?: string
83
78
  receivedDestinationAddress?: string
84
79
  } | null
85
- getRelayer: (chainId: number) => any // TODO: Add proper type
86
80
  estimatedGas: bigint | undefined
87
81
  isEstimateError: boolean
88
82
  estimateError: Error | null
89
83
  calculateIntentAddress: typeof calculateIntentAddress
90
84
  calculateOriginAndDestinationIntentAddresses: typeof calculateOriginAndDestinationIntentAddresses
91
- committedIntentConfig: GetIntentConfigReturn | undefined
85
+ committedIntentConfig: Intent | undefined
92
86
  isLoadingCommittedConfig: boolean
93
87
  committedConfigError: Error | null
94
- commitIntentConfig: (args: {
95
- mainSignerAddress: string
96
- calls: IntentCallsPayload[]
97
- preconditions: IntentPrecondition[]
98
- quoteProvider: QuoteProvider
99
- addressOverrides?: AddressOverrides
88
+ commitIntent: (intent: Intent) => void
89
+ commitIntentPending: boolean
90
+ commitIntentSuccess: boolean
91
+ commitIntentError: Error | null
92
+ commitIntentArgs: Intent | undefined
93
+ executeIntent: (args: {
94
+ intentId: string
95
+ depositTransactionHash: string
100
96
  }) => void
101
- commitIntentConfigPending: boolean
102
- commitIntentConfigSuccess: boolean
103
- commitIntentConfigError: Error | null
104
- commitIntentConfigArgs:
105
- | {
106
- mainSignerAddress: string
107
- calls: IntentCallsPayload[]
108
- preconditions: IntentPrecondition[]
109
- quoteProvider: QuoteProvider
110
- addressOverrides?: AddressOverrides
111
- }
112
- | undefined
113
- getIntentCallsPayloads: (
114
- args: GetIntentCallsPayloadsArgs,
115
- ) => Promise<GetIntentCallsPayloadsReturn>
97
+ executeIntentPending: boolean
98
+ executeIntentSuccess: boolean
99
+ executeIntentError: Error | null
100
+ getIntent: (args: QuoteIntentRequest) => Promise<Intent>
116
101
  operationHashes: { [key: string]: Hex }
117
- callIntentCallsPayload: (args: GetIntentCallsPayloadsArgs) => void
102
+ callIntentCallsPayload: (args: QuoteIntentRequest) => void
118
103
  sendOriginTransaction: () => Promise<void>
119
104
  switchChain: any // TODO: Add proper type
120
105
  isSwitchingChain: boolean
@@ -148,18 +133,13 @@ export type UseTrailsReturn = {
148
133
  hasAutoExecuted: boolean
149
134
  originCallSuccess: boolean
150
135
  sentMetaTxns: { [key: string]: number }
151
- sendMetaTxn: (selectedId: string | null) => void
152
- sendMetaTxnPending: boolean
153
- sendMetaTxnSuccess: boolean
154
- sendMetaTxnError: Error | null
155
- sendMetaTxnArgs: { selectedId: string | null } | undefined
156
136
  clearIntent: () => void
157
- metaTxnMonitorStatuses: { [key: string]: RelayerOperationStatus }
158
- createIntent: (args: GetIntentCallsPayloadsArgs) => void
137
+ intentReceiptStatus: IntentReceiptStatus | null
138
+ createIntent: (args: QuoteIntentRequest) => void
159
139
  createIntentPending: boolean
160
140
  createIntentSuccess: boolean
161
141
  createIntentError: Error | null
162
- createIntentArgs: GetIntentCallsPayloadsArgs | undefined
142
+ createIntentArgs: QuoteIntentRequest | undefined
163
143
  originCallParams: OriginCallParams | null
164
144
  updateOriginCallParams: (
165
145
  args: { originChainId: number; tokenAddress: string } | null,
@@ -172,13 +152,10 @@ export type UseTrailsReturn = {
172
152
  destinationIntentAddress: string | null
173
153
  }
174
154
 
175
- const RETRY_WINDOW_MS = 10_000
176
-
177
155
  export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
178
156
  const {
179
157
  account,
180
158
  disableAutoExecute = false,
181
- env,
182
159
  sequenceProjectAccessKey,
183
160
  } = config
184
161
  const trailsClient = useTrailsClient({
@@ -194,16 +171,15 @@ export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
194
171
  )
195
172
 
196
173
  // State declarations
197
- const [metaTxns, setMetaTxns] = useState<
198
- GetIntentCallsPayloadsReturn["payloads"]["metaTxns"] | null
199
- >(null)
174
+ const [metaTxns, setMetaTxns] = useState<MetaTxn[] | null>(null)
200
175
  const [intentCallsPayloads, setIntentCallsPayloads] = useState<
201
- GetIntentCallsPayloadsReturn["payloads"]["calls"] | null
176
+ IntentCalls[] | null
202
177
  >(null)
203
178
  const [intentPreconditions, setIntentPreconditions] = useState<
204
- GetIntentCallsPayloadsReturn["payloads"]["preconditions"] | null
179
+ TransactionPrecondition[] | null
205
180
  >(null)
206
- const [trailsFee, setTrailsFee] = useState<TrailsFee | null>(null)
181
+ const [trailsFee, setTrailsFee] = useState<LocalTrailsFee | null>(null)
182
+ const [quoteIntent, setQuoteIntent] = useState<Intent | null>(null)
207
183
  const [txnHash, setTxnHash] = useState<Hex | undefined>()
208
184
  const [committedOriginIntentAddress, setCommittedOriginIntentAddress] =
209
185
  useState<string | null>(null)
@@ -259,10 +235,6 @@ export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
259
235
  receivedDestinationAddress?: string
260
236
  } | null>(null)
261
237
 
262
- const { getRelayer, relayers } = useRelayers({
263
- env,
264
- })
265
-
266
238
  // Add gas estimation hook with proper types
267
239
  const {
268
240
  data: estimatedGas,
@@ -279,36 +251,20 @@ export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
279
251
  : undefined,
280
252
  )
281
253
 
282
- const commitIntentConfigMutation = useMutation({
283
- mutationFn: async (args: {
284
- mainSignerAddress: string
285
- calls: IntentCallsPayload[]
286
- preconditions: IntentPrecondition[]
287
- quoteProvider: QuoteProvider
288
- addressOverrides?: AddressOverrides
289
- }) => {
254
+ // Commit intent mutation with verification logic wrapper
255
+ const baseCommitIntentMutation = useCommitIntent()
256
+
257
+ const commitIntentMutation = useMutation({
258
+ mutationFn: async (intent: Intent) => {
290
259
  logger.console.log(
291
- "[useTrails] commitIntentConfigMutation started with args:",
292
- args,
260
+ "[useTrails] commitIntentMutation started with intent:",
261
+ intent,
293
262
  )
294
- if (!trailsClient) {
295
- logger.console.error("[useTrails] API client not available")
296
- throw new Error("API client not available")
297
- }
298
- if (!args.quoteProvider) {
299
- logger.console.error("[useTrails] quoteProvider is required")
300
- throw new Error("quoteProvider is required")
301
- }
302
263
 
303
264
  try {
304
- logger.console.log("[useTrails] Calculating intent address...")
305
- logger.console.log("[useTrails] Main signer:", args.mainSignerAddress)
306
- logger.console.log("[useTrails] Calls:", args.calls)
307
-
308
- const originChainId =
309
- createIntentMutation.variables?.params.originChainId
265
+ const originChainId = createIntentMutation.variables?.originChainId
310
266
  const destinationChainId =
311
- createIntentMutation.variables?.params.destinationChainId
267
+ createIntentMutation.variables?.destinationChainId
312
268
 
313
269
  if (!originChainId || !destinationChainId) {
314
270
  logger.console.error(
@@ -319,17 +275,21 @@ export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
319
275
  )
320
276
  }
321
277
 
278
+ logger.console.log("[useTrails] Calculating intent address...")
279
+ logger.console.log("[useTrails] Main signer:", intent.ownerAddress)
280
+ logger.console.log("[useTrails] Calls:", intent.calls)
281
+
322
282
  const { originIntentAddress, destinationIntentAddress } =
323
283
  calculateOriginAndDestinationIntentAddresses(
324
- args.mainSignerAddress,
325
- args.calls,
284
+ intent.ownerAddress,
285
+ intent.calls,
326
286
  )
327
287
 
328
288
  const {
329
289
  originAddress: originPreconditionAddress,
330
290
  destinationAddress: destinationPreconditionAddress,
331
291
  } = findPreconditionAddresses(
332
- args.preconditions,
292
+ intent.preconditions,
333
293
  originChainId,
334
294
  destinationChainId,
335
295
  )
@@ -387,21 +347,9 @@ export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
387
347
  )
388
348
  }
389
349
 
390
- // Commit the intent config
391
- logger.console.log("[useTrails] Committing intent config to API...")
392
- const response = await trailsClient.commitIntentConfig({
393
- params: {
394
- originIntentAddress: originIntentAddress.toString(),
395
- destinationIntentAddress: destinationIntentAddress.toString(),
396
- mainSigner: args.mainSignerAddress,
397
- calls: args.calls,
398
- preconditions: args.preconditions,
399
- addressOverrides: {
400
- ...SEQUENCE_V3_CONTRACT_ADDRESSES_OVERRIDES,
401
- ...args.addressOverrides,
402
- },
403
- },
404
- })
350
+ // Commit the intent that was returned from quoteIntent
351
+ logger.console.log("[useTrails] Committing intent to API...")
352
+ const response = await baseCommitIntentMutation.mutateAsync(intent)
405
353
  logger.console.log("[useTrails] API Commit Response:", response)
406
354
  return {
407
355
  originIntentAddress: originIntentAddress.toString(),
@@ -432,13 +380,16 @@ export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
432
380
  },
433
381
  })
434
382
 
383
+ // Execute intent mutation
384
+ const executeIntentMutation = useExecuteIntent()
385
+
435
386
  // New Query to fetch committed intent config
436
387
  const {
437
388
  data: committedIntentConfig,
438
389
  isLoading: isLoadingCommittedConfig,
439
390
  error: committedConfigError,
440
- } = useQuery<GetIntentConfigReturn, Error>({
441
- queryKey: ["getIntentConfig", committedOriginIntentAddress],
391
+ } = useQuery<Intent, Error>({
392
+ queryKey: ["getIntent", committedOriginIntentAddress],
442
393
  queryFn: async () => {
443
394
  if (!trailsClient || !committedOriginIntentAddress) {
444
395
  throw new Error("API client or committed intent address not available")
@@ -447,42 +398,32 @@ export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
447
398
  "Fetching intent config for address:",
448
399
  committedOriginIntentAddress,
449
400
  )
450
- return await trailsClient.getIntentConfig({
451
- intentAddress: committedOriginIntentAddress,
401
+ const response = await trailsClient.getIntent({
402
+ intentId: committedOriginIntentAddress,
452
403
  })
404
+ return response.intent
453
405
  },
454
406
  enabled:
455
407
  !!committedOriginIntentAddress &&
456
408
  !!trailsClient &&
457
- commitIntentConfigMutation.isSuccess,
409
+ commitIntentMutation.isSuccess,
458
410
  staleTime: 1000 * 60 * 5, // 5 minutes
459
411
  retry: 1,
460
412
  })
461
413
 
462
- async function getIntentCallsPayloads(args: GetIntentCallsPayloadsArgs) {
463
- return getIntentCallsPayloadsFromIntents(trailsClient, {
464
- params: {
465
- ...args.params,
466
- addressOverrides: {
467
- ...SEQUENCE_V3_CONTRACT_ADDRESSES_OVERRIDES,
468
- ...args.params.addressOverrides,
469
- },
470
- },
471
- })
414
+ async function getIntent(args: QuoteIntentRequest) {
415
+ const { intent } = await getIntentFromIntents(trailsClient, args)
416
+ return intent
472
417
  }
473
418
 
474
419
  // TODO: Add type for args
475
- const createIntentMutation = useMutation<
476
- GetIntentCallsPayloadsReturn,
477
- Error,
478
- GetIntentCallsPayloadsArgs
479
- >({
480
- mutationFn: async (args: GetIntentCallsPayloadsArgs) => {
420
+ const createIntentMutation = useMutation<Intent, Error, QuoteIntentRequest>({
421
+ mutationFn: async (args: QuoteIntentRequest) => {
481
422
  if (
482
- args.params.originChainId === args.params.destinationChainId &&
423
+ args.originChainId === args.destinationChainId &&
483
424
  isAddressEqual(
484
- Address.from(args.params.originTokenAddress),
485
- Address.from(args.params.destinationTokenAddress),
425
+ Address.from(args.originTokenAddress),
426
+ Address.from(args.destinationTokenAddress),
486
427
  )
487
428
  ) {
488
429
  throw new Error(
@@ -503,14 +444,15 @@ export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
503
444
  setOriginIntentAddress(null)
504
445
  setDestinationIntentAddress(null)
505
446
 
506
- const data = await getIntentCallsPayloads(args)
447
+ const { intent: data } = await getIntentFromIntents(trailsClient, args)
507
448
 
508
- setMetaTxns(data.payloads.metaTxns)
509
- setIntentCallsPayloads(data.payloads.calls)
510
- setIntentPreconditions(data.payloads.preconditions)
511
- setTrailsFee(data.payloads.trailsFee!)
512
- setOriginIntentAddress(data.payloads.originIntentAddress)
513
- setDestinationIntentAddress(data.payloads.destinationIntentAddress)
449
+ setMetaTxns(data.metaTxns)
450
+ setIntentCallsPayloads(data.calls)
451
+ setIntentPreconditions(data.preconditions)
452
+ setTrailsFee(data.fees as any)
453
+ setOriginIntentAddress(data.originIntentAddress)
454
+ setDestinationIntentAddress(data.destinationIntentAddress)
455
+ setQuoteIntent(data)
514
456
  setCommittedOriginIntentAddress(null)
515
457
  setCommittedDestinationIntentAddress(null)
516
458
 
@@ -520,21 +462,21 @@ export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
520
462
  onSuccess: (data) => {
521
463
  logger.console.log("Intent Config Success:", data)
522
464
 
523
- setTrailsFee(data.payloads.trailsFee || null)
524
- setOriginIntentAddress(data.payloads.originIntentAddress)
525
- setDestinationIntentAddress(data.payloads.destinationIntentAddress)
465
+ setTrailsFee((data.fees || null) as any)
466
+ setOriginIntentAddress(data.originIntentAddress)
467
+ setDestinationIntentAddress(data.destinationIntentAddress)
526
468
 
527
469
  if (
528
- data.payloads?.calls &&
529
- data.payloads.calls.length > 0 &&
530
- data.payloads.preconditions &&
531
- data.payloads.preconditions.length > 0 &&
532
- data.payloads.metaTxns &&
533
- data.payloads.metaTxns.length > 0
470
+ data?.calls &&
471
+ data.calls.length > 0 &&
472
+ data.preconditions &&
473
+ data.preconditions.length > 0 &&
474
+ data.metaTxns &&
475
+ data.metaTxns.length > 0
534
476
  ) {
535
- setIntentCallsPayloads(data.payloads.calls)
536
- setIntentPreconditions(data.payloads.preconditions)
537
- setMetaTxns(data.payloads.metaTxns)
477
+ setIntentCallsPayloads(data.calls)
478
+ setIntentPreconditions(data.preconditions)
479
+ setMetaTxns(data.metaTxns)
538
480
  } else {
539
481
  logger.console.warn("API returned success but no operations found.")
540
482
  setIntentCallsPayloads(null)
@@ -553,7 +495,7 @@ export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
553
495
  },
554
496
  })
555
497
 
556
- function callIntentCallsPayload(args: GetIntentCallsPayloadsArgs) {
498
+ function callIntentCallsPayload(args: QuoteIntentRequest) {
557
499
  createIntentMutation.mutate(args)
558
500
  }
559
501
 
@@ -819,7 +761,6 @@ export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
819
761
  })
820
762
 
821
763
  // Modify the effect that watches for transaction status
822
- // biome-ignore lint/correctness/useExhaustiveDependencies: False positive
823
764
  useEffect(() => {
824
765
  if (!txnHash) {
825
766
  // Only reset these when txnHash is cleared
@@ -871,35 +812,8 @@ export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
871
812
  : undefined,
872
813
  })
873
814
 
874
- if (newStatus === "Success" && receipt.blockNumber) {
875
- const fetchTimestamp = async () => {
876
- try {
877
- if (!originCallParams?.chainId) {
878
- logger.console.error(
879
- "[Trails] Origin chainId not available for fetching origin block timestamp.",
880
- )
881
- setOriginBlockTimestamp(null)
882
- return
883
- }
884
- const chainConfig = getChainInfo(originCallParams.chainId)!
885
- const client = createPublicClient({
886
- chain: chainConfig,
887
- transport: http(),
888
- })
889
- const block = await client.getBlock({
890
- blockNumber: BigInt(receipt.blockNumber),
891
- })
892
- setOriginBlockTimestamp(Number(block.timestamp))
893
- } catch (error) {
894
- logger.console.error(
895
- "[Trails] Error fetching origin block timestamp:",
896
- error,
897
- )
898
- setOriginBlockTimestamp(null)
899
- }
900
- }
901
- fetchTimestamp()
902
- } else if (newStatus !== "Success") {
815
+ // Timestamp is now available from transaction receipts via the API (txnMinedAt)
816
+ if (newStatus !== "Success") {
903
817
  setOriginBlockTimestamp(null)
904
818
  }
905
819
 
@@ -911,9 +825,16 @@ export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
911
825
  !metaTxns.some((tx: MetaTxn) => sentMetaTxns[`${tx.chainId}-${tx.id}`])
912
826
  ) {
913
827
  logger.console.log(
914
- "Origin transaction successful, auto-sending all meta transactions...",
828
+ "Origin transaction successful, calling executeIntent and auto-sending all meta transactions...",
915
829
  )
916
- sendMetaTxnMutation.mutate({ selectedId: null })
830
+
831
+ // Call executeIntent with intentId and depositTransactionHash
832
+ if (committedOriginIntentAddress && txnHash) {
833
+ executeIntentMutation.mutate({
834
+ intentId: committedOriginIntentAddress,
835
+ depositTransactionHash: txnHash,
836
+ })
837
+ }
917
838
  }
918
839
  } else if (receiptIsError) {
919
840
  setOriginCallStatus({
@@ -937,16 +858,17 @@ export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
937
858
  metaTxns,
938
859
  sentMetaTxns,
939
860
  isAutoExecute,
940
- originCallParams?.chainId,
941
861
  originCallStatus?.status,
942
862
  originCallStatus?.txnHash,
863
+ committedOriginIntentAddress,
864
+ executeIntentMutation,
943
865
  ])
944
866
 
945
867
  // Modify the auto-execute effect
946
868
  useEffect(() => {
947
869
  const shouldAutoSend =
948
870
  isAutoExecute &&
949
- commitIntentConfigMutation.isSuccess &&
871
+ commitIntentMutation.isSuccess &&
950
872
  originCallParams?.chainId &&
951
873
  account.chainId === originCallParams.chainId &&
952
874
  !originCallParams.error &&
@@ -1002,7 +924,7 @@ export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
1002
924
  }
1003
925
  }, [
1004
926
  isAutoExecute,
1005
- commitIntentConfigMutation.isSuccess,
927
+ commitIntentMutation.isSuccess,
1006
928
  originCallParams,
1007
929
  account.chainId,
1008
930
  sendOriginTxn.isPending,
@@ -1023,286 +945,25 @@ export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
1023
945
  trailsFee &&
1024
946
  account.address &&
1025
947
  originIntentAddress &&
1026
- !commitIntentConfigMutation.isPending &&
1027
- !commitIntentConfigMutation.isSuccess
948
+ !commitIntentMutation.isPending &&
949
+ !commitIntentMutation.isSuccess
1028
950
  ) {
1029
951
  logger.console.log("Auto-committing intent configuration...")
1030
- commitIntentConfigMutation.mutate({
1031
- mainSignerAddress: account.address,
1032
- calls: intentCallsPayloads,
1033
- preconditions: intentPreconditions,
1034
- quoteProvider: trailsFee.quoteProvider as QuoteProvider,
1035
- addressOverrides:
1036
- createIntentMutation.variables?.params.addressOverrides,
1037
- })
952
+ if (quoteIntent) {
953
+ commitIntentMutation.mutate(quoteIntent)
954
+ }
1038
955
  }
1039
956
  }, [
1040
957
  isAutoExecute,
958
+ quoteIntent,
1041
959
  intentCallsPayloads,
1042
960
  intentPreconditions,
1043
961
  trailsFee,
1044
962
  account.address,
1045
963
  originIntentAddress,
1046
- commitIntentConfigMutation,
1047
- createIntentMutation.variables,
964
+ commitIntentMutation,
1048
965
  ])
1049
966
 
1050
- // Update the sendMetaTxn mutation
1051
- const sendMetaTxnMutation = useMutation({
1052
- mutationFn: async ({ selectedId }: { selectedId: string | null }) => {
1053
- logger.console.log("[trails-sdk] Starting sendMetaTxn mutation", {
1054
- selectedId,
1055
- hasIntentCallsPayloads: !!intentCallsPayloads,
1056
- hasIntentPreconditions: !!intentPreconditions,
1057
- hasMetaTxns: !!metaTxns,
1058
- hasAccountAddress: !!account.address,
1059
- quoteProvider: trailsFee?.quoteProvider,
1060
- })
1061
-
1062
- if (
1063
- !intentCallsPayloads ||
1064
- !intentPreconditions ||
1065
- !metaTxns ||
1066
- !account.address
1067
- ) {
1068
- throw new Error("Missing required data for meta-transaction")
1069
- }
1070
-
1071
- if (!trailsFee?.quoteProvider) {
1072
- throw new Error("quoteProvider is required")
1073
- }
1074
-
1075
- const intentAddress = calculateIntentAddress(
1076
- account.address,
1077
- intentCallsPayloads as any[],
1078
- )
1079
-
1080
- // If no specific ID is selected, send all meta transactions
1081
- const txnsToSend = selectedId
1082
- ? [metaTxns.find((tx: MetaTxn) => tx.id === selectedId)]
1083
- : metaTxns
1084
-
1085
- logger.console.log("[trails-sdk] Selected transactions to send", {
1086
- selectedId,
1087
- totalMetaTxns: metaTxns.length,
1088
- txnsToSendCount: txnsToSend.filter((tx) => tx).length,
1089
- txnsToSend: txnsToSend
1090
- .filter((tx) => tx)
1091
- .map((tx) => ({
1092
- id: tx?.id,
1093
- chainId: tx?.chainId,
1094
- walletAddress: tx?.walletAddress,
1095
- contract: tx?.contract,
1096
- })),
1097
- })
1098
-
1099
- if (!txnsToSend || (selectedId && !txnsToSend[0])) {
1100
- throw new Error("Meta transaction not found")
1101
- }
1102
-
1103
- const results = []
1104
-
1105
- for (const metaTxn of txnsToSend) {
1106
- if (!metaTxn) continue
1107
-
1108
- const operationKey = `${metaTxn.chainId}-${metaTxn.id}`
1109
- const lastSentTime = sentMetaTxns[operationKey]
1110
- const now = Date.now()
1111
-
1112
- logger.console.log(
1113
- `[trails-sdk] Processing meta transaction ${operationKey}`,
1114
- {
1115
- metaTxnId: metaTxn.id,
1116
- chainId: metaTxn.chainId,
1117
- walletAddress: metaTxn.walletAddress,
1118
- contract: metaTxn.contract,
1119
- intentAddress,
1120
- },
1121
- )
1122
-
1123
- if (lastSentTime && now - lastSentTime < RETRY_WINDOW_MS) {
1124
- const timeLeft = Math.ceil(
1125
- (RETRY_WINDOW_MS - (now - lastSentTime)) / 1000,
1126
- )
1127
- logger.console.log(
1128
- `[trails-sdk] Meta transaction for ${operationKey} was sent recently. Wait ${timeLeft}s before retry`,
1129
- {
1130
- lastSentTime,
1131
- now,
1132
- timeLeft,
1133
- },
1134
- )
1135
- continue
1136
- }
1137
-
1138
- try {
1139
- const chainId = parseInt(metaTxn.chainId, 10)
1140
- if (Number.isNaN(chainId) || chainId <= 0) {
1141
- logger.console.error(
1142
- `[trails-sdk] Invalid chainId for meta transaction`,
1143
- {
1144
- chainId,
1145
- operationKey,
1146
- metaTxn,
1147
- },
1148
- )
1149
- throw new Error(`Invalid chainId for meta transaction: ${chainId}`)
1150
- }
1151
- const chainRelayer = getRelayer(chainId)
1152
- if (!chainRelayer) {
1153
- logger.console.error(`[trails-sdk] No relayer found for chainId`, {
1154
- chainId,
1155
- operationKey,
1156
- availableRelayers: Array.from(relayers.keys()),
1157
- })
1158
- throw new Error(`No relayer found for chainId: ${chainId}`)
1159
- }
1160
-
1161
- const relevantPreconditions = intentPreconditions.filter(
1162
- (p: IntentPrecondition) =>
1163
- p.chainId && parseInt(p.chainId, 10) === chainId,
1164
- )
1165
-
1166
- logger.console.log(
1167
- `[trails-sdk] Relaying meta transaction ${operationKey} to intent ${intentAddress} via relayer`,
1168
- {
1169
- chainId,
1170
- operationKey,
1171
- intentAddress,
1172
- relayer: !!chainRelayer,
1173
- preconditionsCount: relevantPreconditions.length,
1174
- },
1175
- )
1176
-
1177
- const { opHash } = await chainRelayer.sendMetaTxn(
1178
- metaTxn.walletAddress as Address.Address,
1179
- metaTxn.contract as Address.Address,
1180
- metaTxn.input as Hex,
1181
- Number(metaTxn.chainId),
1182
- undefined,
1183
- relevantPreconditions,
1184
- )
1185
-
1186
- logger.console.log(
1187
- `[trails-sdk] Successfully sent meta transaction ${operationKey}`,
1188
- {
1189
- operationKey,
1190
- opHash,
1191
- chainId,
1192
- },
1193
- )
1194
-
1195
- const useBackupRelayer = false // Disable backup relayer for now
1196
- if (useBackupRelayer) {
1197
- try {
1198
- // Fire and forget send tx to backup relayer
1199
- const backupRelayer = getBackupRelayer(chainId)
1200
-
1201
- backupRelayer
1202
- ?.sendMetaTxn(
1203
- metaTxn.walletAddress as Address.Address,
1204
- metaTxn.contract as Address.Address,
1205
- metaTxn.input as Hex,
1206
- Number(metaTxn.chainId),
1207
- undefined,
1208
- relevantPreconditions,
1209
- )
1210
- .then(() => {
1211
- logger.console.log(
1212
- `[trails-sdk] Backup relayer sent for ${operationKey}`,
1213
- )
1214
- })
1215
- .catch((backupError) => {
1216
- logger.console.warn(
1217
- `[trails-sdk] Backup relayer failed for ${operationKey}`,
1218
- backupError,
1219
- )
1220
- })
1221
- } catch {}
1222
- }
1223
-
1224
- results.push({
1225
- operationKey,
1226
- opHash,
1227
- success: true,
1228
- })
1229
- } catch (error: unknown) {
1230
- const errorMessage =
1231
- error instanceof Error ? error.message : "Unknown error"
1232
- logger.console.error(
1233
- `[trails-sdk] Failed to send meta transaction ${operationKey}`,
1234
- {
1235
- operationKey,
1236
- error: errorMessage,
1237
- chainId: metaTxn.chainId,
1238
- metaTxnId: metaTxn.id,
1239
- walletAddress: metaTxn.walletAddress,
1240
- contract: metaTxn.contract,
1241
- },
1242
- )
1243
-
1244
- results.push({
1245
- operationKey,
1246
- error: errorMessage,
1247
- success: false,
1248
- })
1249
- }
1250
- }
1251
-
1252
- return results
1253
- },
1254
- onSuccess: (results) => {
1255
- logger.console.log(
1256
- "[trails-sdk] sendMetaTxn mutation completed successfully",
1257
- {
1258
- totalResults: results.length,
1259
- successfulResults: results.filter((r) => r.success).length,
1260
- failedResults: results.filter((r) => !r.success).length,
1261
- results: results.map((r) => ({
1262
- operationKey: r.operationKey,
1263
- success: r.success,
1264
- opHash: r.opHash || null,
1265
- error: r.error || null,
1266
- })),
1267
- },
1268
- )
1269
-
1270
- // Update states based on results
1271
- results.forEach(({ operationKey, opHash, success }) => {
1272
- if (success && opHash) {
1273
- setSentMetaTxns((prev) => ({
1274
- ...prev,
1275
- [operationKey]: Date.now(),
1276
- }))
1277
-
1278
- setOperationHashes((prev) => ({
1279
- ...prev,
1280
- [operationKey]: opHash,
1281
- }))
1282
- } else {
1283
- logger.console.warn(
1284
- `[trails-sdk] Not updating state for failed meta transaction ${operationKey}`,
1285
- {
1286
- operationKey,
1287
- error: results.find((r) => r.operationKey === operationKey)
1288
- ?.error,
1289
- },
1290
- )
1291
- }
1292
- })
1293
- },
1294
- onError: (error) => {
1295
- logger.console.error("[trails-sdk] Error in meta-transaction process", {
1296
- error: error instanceof Error ? error.message : String(error),
1297
- errorType:
1298
- error instanceof Error ? error.constructor.name : typeof error,
1299
- stack: error instanceof Error ? error.stack : undefined,
1300
- })
1301
- },
1302
- retry: 5, // Allow up to 2 retries
1303
- retryDelay: (attemptIndex) => Math.min(1000 * 2 ** attemptIndex, 30000), // Exponential backoff
1304
- })
1305
-
1306
967
  const [tokenAddress, setTokenAddress] = useState<string | null>(null)
1307
968
  const [originChainId, setOriginChainId] = useState<number | null>(null)
1308
969
 
@@ -1333,39 +994,36 @@ export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
1333
994
 
1334
995
  const recipientAddress = intentAddressString
1335
996
 
1336
- const isNative = tokenAddress === zeroAddress
997
+ const isNative =
998
+ tokenAddress === zeroAddress || tokenAddress === ethAddress
1337
999
 
1338
1000
  if (isNative) {
1339
1001
  const nativePrecondition = intentPreconditions.find(
1340
- (p: IntentPrecondition) =>
1002
+ (p: TransactionPrecondition) =>
1341
1003
  (p.type === "transfer-native" || p.type === "native-balance") &&
1342
- p.chainId === originChainId.toString(),
1004
+ p.chainId === originChainId,
1343
1005
  )
1344
- const nativeMinAmount = nativePrecondition?.data?.min?.toString()
1006
+ const nativeMinAmount = nativePrecondition?.minAmount?.toString()
1345
1007
  if (nativeMinAmount === undefined) {
1346
- throw new Error(
1347
- "Could not find native precondition (transfer-native or native-balance) or min amount",
1348
- )
1008
+ throw new Error("Could not find precondition or min amount")
1349
1009
  }
1350
1010
  calcValue = BigInt(nativeMinAmount)
1351
1011
  calcTo = recipientAddress
1352
1012
  } else {
1353
1013
  const erc20Precondition = intentPreconditions.find(
1354
- (p: IntentPrecondition) =>
1014
+ (p: TransactionPrecondition) =>
1355
1015
  p.type === "erc20-balance" &&
1356
- p.chainId === originChainId.toString() &&
1357
- p.data?.token &&
1016
+ p.chainId === originChainId &&
1017
+ p.tokenAddress &&
1358
1018
  isAddressEqual(
1359
- Address.from(p.data.token),
1019
+ Address.from(p.tokenAddress),
1360
1020
  Address.from(tokenAddress),
1361
1021
  ),
1362
1022
  )
1363
1023
 
1364
- const erc20MinAmount = erc20Precondition?.data?.min?.toString()
1024
+ const erc20MinAmount = erc20Precondition?.minAmount?.toString()
1365
1025
  if (erc20MinAmount === undefined) {
1366
- throw new Error(
1367
- "Could not find ERC20 balance precondition or min amount",
1368
- )
1026
+ throw new Error("Could not find precondition or min amount")
1369
1027
  }
1370
1028
  calcData = getERC20TransferData({
1371
1029
  recipient: recipientAddress,
@@ -1444,232 +1102,91 @@ export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
1444
1102
  // }
1445
1103
  // }, [intentPreconditions, checkPreconditionStatuses])
1446
1104
 
1447
- // Add monitoring for each meta transaction
1448
- const metaTxnMonitorStatuses = useMetaTxnsMonitor(
1449
- metaTxns as unknown as MetaTxn[] | undefined,
1450
- getRelayer,
1105
+ // Use the new WaitIntentReceipt API to monitor intent execution
1106
+ // This replaces the old per-meta-transaction polling approach
1107
+ const intentReceiptStatus = useIntentReceiptMonitor(
1108
+ committedOriginIntentAddress ?? undefined,
1109
+ trailsClient,
1451
1110
  )
1452
1111
 
1453
- // Create a stable dependency for the meta timestamp effect
1454
- const _stableMetaTxnStatusesKey = useMemo(() => {
1455
- if (!metaTxns || Object.keys(metaTxnMonitorStatuses).length === 0) {
1456
- return "no_statuses"
1457
- }
1458
- // Sort by a stable key (e.g., id) to ensure consistent order if metaTxns array order changes
1459
- // but content is the same, though metaTxns itself is a dependency, so this might be redundant if metaTxns order is stable.
1460
- const sortedTxnIds = metaTxns
1461
- .map((tx: MetaTxn) => `${tx.chainId}-${tx.id}`)
1462
- .sort()
1463
-
1464
- return sortedTxnIds
1465
- .map((key: string) => {
1466
- const statusObj = metaTxnMonitorStatuses[key]
1467
- return `${key}:${statusObj ? statusObj.status : "loading"}`
1468
- })
1469
- .join(",")
1470
- }, [metaTxns, metaTxnMonitorStatuses])
1471
-
1472
- const processedTxns = useRef(new Set<string>())
1473
- const lastQueuedCctpSourceTxHash = useRef<string | null>(null)
1474
-
1475
- // Effect to fetch meta-transaction block timestamps
1112
+ // Simplified block timestamp tracking using IntentReceipt API
1113
+ // The IntentReceipt provides unified status for both origin and destination transactions
1476
1114
  useEffect(() => {
1477
- logger.console.log(
1478
- "[trails-sdk] Running meta-transaction block timestamp effect:",
1479
- {
1480
- metaTxnsLength: metaTxns?.length,
1481
- monitorStatusesLength: Object.keys(metaTxnMonitorStatuses).length,
1482
- },
1483
- )
1484
-
1485
- if (!metaTxns || metaTxns.length === 0) {
1486
- logger.console.log(
1487
- "[trails-sdk] No meta transactions, clearing timestamps",
1488
- )
1489
- processedTxns.current.clear()
1490
- if (Object.keys(metaTxnBlockTimestamps).length > 0) {
1491
- setMetaTxnBlockTimestamps({})
1492
- }
1493
- return
1494
- }
1115
+ logger.console.log("[trails-sdk] Intent receipt status update:", {
1116
+ intentId: committedOriginIntentAddress,
1117
+ done: intentReceiptStatus.done,
1118
+ hasReceipt: !!intentReceiptStatus.intentReceipt,
1119
+ })
1495
1120
 
1496
- if (!Object.keys(metaTxnMonitorStatuses).length) {
1497
- logger.console.log("[trails-sdk] No monitor statuses yet, waiting...")
1121
+ if (!intentReceiptStatus.intentReceipt) {
1122
+ logger.console.log("[trails-sdk] No intent receipt yet, waiting...")
1498
1123
  return
1499
1124
  }
1500
1125
 
1501
- metaTxns.forEach(async (metaTxn: MetaTxn, index: number) => {
1502
- const operationKey = `${metaTxn.chainId}-${metaTxn.id}`
1503
-
1504
- // Skip if already processed
1505
- if (processedTxns.current.has(operationKey)) {
1506
- logger.console.log(
1507
- `[trails-sdk] MetaTxn ${operationKey}: Already processed, skipping`,
1508
- )
1509
- return
1510
- }
1511
-
1512
- const monitorStatus = metaTxnMonitorStatuses[operationKey]
1513
- if (!monitorStatus || monitorStatus.status !== "confirmed") {
1514
- logger.console.log(
1515
- `[trails-sdk] MetaTxn ${operationKey}: Status not confirmed, skipping`,
1516
- )
1517
- return
1518
- }
1126
+ // Update block timestamps from intent receipt transactions
1127
+ const newTimestamps: typeof metaTxnBlockTimestamps = {}
1519
1128
 
1520
- // Type assertion since we know it exists when status is "confirmed"
1521
- const transactionHash = monitorStatus.transactionHash as Hex | undefined
1522
- if (!transactionHash) {
1523
- logger.console.log(
1524
- `[trails-sdk] MetaTxn ${operationKey}: No transaction hash, skipping`,
1525
- )
1526
- return
1527
- }
1528
-
1529
- logger.console.log(
1530
- `[trails-sdk] MetaTxn ${operationKey}: Processing transaction ${transactionHash}`,
1531
- )
1532
- processedTxns.current.add(operationKey)
1129
+ if (intentReceiptStatus.intentReceipt.originTransaction) {
1130
+ const originTx = intentReceiptStatus.intentReceipt.originTransaction
1131
+ const key = `${originTx.chainId}-${originTx.metaTxnId}`
1132
+ newTimestamps[key] = { timestamp: null } // TODO: fetch actual block timestamp
1133
+ }
1533
1134
 
1534
- try {
1535
- const chainId = parseInt(metaTxn.chainId, 10)
1536
- if (Number.isNaN(chainId) || chainId <= 0) {
1537
- throw new Error(
1538
- `Invalid chainId for meta transaction: ${metaTxn.chainId}`,
1539
- )
1540
- }
1135
+ if (intentReceiptStatus.intentReceipt.destinationTransaction) {
1136
+ const destTx = intentReceiptStatus.intentReceipt.destinationTransaction
1137
+ const key = `${destTx.chainId}-${destTx.metaTxnId}`
1138
+ newTimestamps[key] = { timestamp: null } // TODO: fetch actual block timestamp
1139
+ }
1541
1140
 
1542
- const chainConfig = getChainInfo(chainId)!
1543
- const client = createPublicClient({
1544
- chain: chainConfig,
1545
- transport: http(),
1546
- })
1141
+ setMetaTxnBlockTimestamps(newTimestamps)
1142
+ }, [
1143
+ intentReceiptStatus.intentReceipt,
1144
+ intentReceiptStatus.done,
1145
+ committedOriginIntentAddress,
1146
+ ])
1547
1147
 
1548
- const receipt = await client.getTransactionReceipt({
1549
- hash: transactionHash,
1550
- })
1148
+ // Effect to handle completed intent
1149
+ useEffect(() => {
1150
+ if (intentReceiptStatus.done && intentReceiptStatus.intentReceipt) {
1151
+ logger.console.log("[trails-sdk] Intent execution completed", {
1152
+ intentId: committedOriginIntentAddress,
1153
+ status: intentReceiptStatus.intentReceipt.status,
1154
+ })
1551
1155
 
1552
- if (receipt && typeof receipt.blockNumber === "bigint") {
1553
- const block = await client.getBlock({
1554
- blockNumber: receipt.blockNumber,
1555
- })
1556
- logger.console.log(
1557
- `[trails-sdk] MetaTxn ${operationKey}: Got block timestamp ${block.timestamp}`,
1558
- )
1559
- setMetaTxnBlockTimestamps((prev) => ({
1560
- ...prev,
1561
- [operationKey]: {
1562
- timestamp: Number(block.timestamp),
1563
- error: undefined,
1564
- },
1565
- }))
1566
-
1567
- // Queue CCTP transfer using the first confirmed origin meta-tx hash
1156
+ // Handle CCTP transfers if needed
1157
+ if (intentReceiptStatus.intentReceipt.originTransaction?.txnHash) {
1158
+ const providerFromQuote = trailsFee?.quoteProvider
1159
+ ? String(trailsFee.quoteProvider).toLowerCase()
1160
+ : undefined
1161
+ const providerFromArgs = createIntentMutation.variables?.options
1162
+ ?.quoteProvider
1163
+ ? String(
1164
+ createIntentMutation.variables.options.quoteProvider,
1165
+ ).toLowerCase()
1166
+ : undefined
1167
+ const isCctp =
1168
+ providerFromQuote === "cctp" || providerFromArgs === "cctp"
1169
+
1170
+ if (isCctp && createIntentMutation.variables) {
1568
1171
  try {
1569
- const providerFromQuote = trailsFee?.quoteProvider
1570
- ? String(trailsFee.quoteProvider).toLowerCase()
1571
- : undefined
1572
- const providerFromArgs = createIntentMutation.variables?.params
1573
- .provider
1574
- ? String(
1575
- createIntentMutation.variables.params.provider,
1576
- ).toLowerCase()
1577
- : undefined
1578
- const isCctp =
1579
- providerFromQuote === "cctp" || providerFromArgs === "cctp"
1580
-
1581
- const originChainIdForCctp =
1582
- createIntentMutation.variables?.params.originChainId
1583
- const destinationChainIdForCctp =
1584
- createIntentMutation.variables?.params.destinationChainId
1585
-
1586
- logger.console.log("[Trails] isCctp", isCctp)
1587
- logger.console.log("[Trails] providerFromQuote", providerFromQuote)
1588
- logger.console.log("[Trails] providerFromArgs", providerFromArgs)
1589
- logger.console.log("[Trails] trailsFee", trailsFee)
1590
- logger.console.log(
1591
- "[Trails] createIntentMutation.variables",
1592
- createIntentMutation.variables,
1593
- )
1594
- logger.console.log(
1595
- "[Trails] createIntentMutation.variables.params.provider",
1596
- createIntentMutation.variables?.params.provider,
1597
- )
1598
- logger.console.log(
1599
- "[Trails] createIntentMutation.variables.params.originChainId",
1600
- createIntentMutation.variables?.params.originChainId,
1601
- )
1602
- logger.console.log(
1603
- "[Trails] createIntentMutation.variables.params.destinationChainId",
1604
- createIntentMutation.variables?.params.destinationChainId,
1605
- )
1606
- logger.console.log(
1607
- "[Trails] lastQueuedCctpSourceTxHash",
1608
- lastQueuedCctpSourceTxHash.current,
1609
- )
1610
- logger.console.log("[Trails] transactionHash", transactionHash)
1611
- logger.console.log(
1612
- "[Trails] originChainIdForCctp",
1613
- originChainIdForCctp,
1614
- )
1615
- logger.console.log(
1616
- "[Trails] destinationChainIdForCctp",
1617
- destinationChainIdForCctp,
1618
- )
1619
-
1620
- if (
1621
- isCctp &&
1622
- trailsClient &&
1623
- transactionHash &&
1624
- typeof originChainIdForCctp === "number" &&
1625
- typeof destinationChainIdForCctp === "number" &&
1626
- lastQueuedCctpSourceTxHash.current !== transactionHash &&
1627
- index === 0
1628
- ) {
1629
- lastQueuedCctpSourceTxHash.current = transactionHash
1630
- await queueCCTPTransfer({
1631
- trailsClient,
1632
- sourceTxHash: transactionHash,
1633
- sourceChainId: originChainIdForCctp,
1634
- destinationChainId: destinationChainIdForCctp,
1635
- })
1636
- }
1637
- } catch (err) {
1638
- logger.console.error(
1639
- `[trails-sdk] Queue CCTP on meta-tx error (${operationKey}):`,
1640
- err,
1641
- )
1172
+ queueCCTPTransfer({
1173
+ sourceTxHash: intentReceiptStatus.intentReceipt.originTransaction
1174
+ .txnHash as `0x${string}`,
1175
+ sourceChainId: createIntentMutation.variables.originChainId,
1176
+ destinationChainId:
1177
+ createIntentMutation.variables.destinationChainId,
1178
+ trailsClient,
1179
+ })
1180
+ } catch (error) {
1181
+ logger.console.error("[Trails] queueCCTPTransfer error", error)
1642
1182
  }
1643
- } else {
1644
- logger.console.warn(
1645
- `[trails-sdk] MetaTxn ${operationKey}: No block number in receipt`,
1646
- )
1647
- setMetaTxnBlockTimestamps((prev) => ({
1648
- ...prev,
1649
- [operationKey]: {
1650
- timestamp: null,
1651
- error: "Block number not found in receipt",
1652
- },
1653
- }))
1654
1183
  }
1655
- } catch (error: any) {
1656
- logger.console.error(
1657
- `[trails-sdk] MetaTxn ${operationKey}: Error:`,
1658
- error,
1659
- )
1660
- setMetaTxnBlockTimestamps((prev) => ({
1661
- ...prev,
1662
- [operationKey]: {
1663
- timestamp: null,
1664
- error: error.message || "Failed to fetch receipt/timestamp",
1665
- },
1666
- }))
1667
1184
  }
1668
- })
1185
+ }
1669
1186
  }, [
1670
- metaTxns,
1671
- metaTxnMonitorStatuses,
1672
- metaTxnBlockTimestamps,
1187
+ intentReceiptStatus.done,
1188
+ intentReceiptStatus.intentReceipt,
1189
+ committedOriginIntentAddress,
1673
1190
  trailsFee,
1674
1191
  createIntentMutation.variables,
1675
1192
  trailsClient,
@@ -1679,22 +1196,13 @@ export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
1679
1196
  setIsAutoExecute(enabled)
1680
1197
  }
1681
1198
 
1682
- function createIntent(args: GetIntentCallsPayloadsArgs) {
1683
- createIntentMutation.mutate({
1684
- ...args,
1685
- destinationSalt: Date.now().toString(),
1686
- } as GetIntentCallsPayloadsArgs)
1199
+ function createIntent(args: QuoteIntentRequest) {
1200
+ createIntentMutation.mutate(args)
1687
1201
  }
1688
1202
 
1689
- function commitIntentConfig(args: {
1690
- mainSignerAddress: string
1691
- calls: IntentCallsPayload[]
1692
- preconditions: IntentPrecondition[]
1693
- quoteProvider: QuoteProvider
1694
- addressOverrides?: AddressOverrides
1695
- }) {
1696
- logger.console.log("[trails-sdk] commitIntentConfig", args)
1697
- commitIntentConfigMutation.mutate(args)
1203
+ function commitIntent(intent: Intent) {
1204
+ logger.console.log("[trails-sdk] commitIntent", intent)
1205
+ commitIntentMutation.mutate(intent)
1698
1206
  }
1699
1207
 
1700
1208
  function updateOriginCallParams(
@@ -1709,10 +1217,6 @@ export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
1709
1217
  setTokenAddress(tokenAddress)
1710
1218
  }
1711
1219
 
1712
- function sendMetaTxn(selectedId: string | null) {
1713
- sendMetaTxnMutation.mutate({ selectedId })
1714
- }
1715
-
1716
1220
  const { chainId } = account
1717
1221
 
1718
1222
  const originChainIdFromParams = originCallParams?.chainId
@@ -1722,15 +1226,21 @@ export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
1722
1226
  const createIntentError = createIntentMutation.error
1723
1227
  const createIntentArgs = createIntentMutation.variables
1724
1228
 
1725
- const commitIntentConfigPending = commitIntentConfigMutation.isPending
1726
- const commitIntentConfigSuccess = commitIntentConfigMutation.isSuccess
1727
- const commitIntentConfigError = commitIntentConfigMutation.error
1728
- const commitIntentConfigArgs = commitIntentConfigMutation.variables
1229
+ const commitIntentPending = commitIntentMutation.isPending
1230
+ const commitIntentSuccess = commitIntentMutation.isSuccess
1231
+ const commitIntentError = commitIntentMutation.error
1232
+ const commitIntentArgs = commitIntentMutation.variables
1233
+
1234
+ const executeIntentPending = executeIntentMutation.isPending
1235
+ const executeIntentSuccess = executeIntentMutation.isSuccess
1236
+ const executeIntentError = executeIntentMutation.error
1729
1237
 
1730
- const sendMetaTxnPending = sendMetaTxnMutation.isPending
1731
- const sendMetaTxnSuccess = sendMetaTxnMutation.isSuccess
1732
- const sendMetaTxnError = sendMetaTxnMutation.error
1733
- const sendMetaTxnArgs = sendMetaTxnMutation.variables
1238
+ function executeIntent(args: {
1239
+ intentId: string
1240
+ depositTransactionHash: string
1241
+ }) {
1242
+ executeIntentMutation.mutate(args)
1243
+ }
1734
1244
 
1735
1245
  return {
1736
1246
  trailsClient,
@@ -1742,7 +1252,6 @@ export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
1742
1252
  committedOriginIntentAddress,
1743
1253
  committedDestinationIntentAddress,
1744
1254
  verificationStatus,
1745
- getRelayer,
1746
1255
  estimatedGas,
1747
1256
  isEstimateError,
1748
1257
  estimateError,
@@ -1751,12 +1260,16 @@ export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
1751
1260
  committedIntentConfig,
1752
1261
  isLoadingCommittedConfig,
1753
1262
  committedConfigError,
1754
- commitIntentConfig,
1755
- commitIntentConfigPending,
1756
- commitIntentConfigSuccess,
1757
- commitIntentConfigError,
1758
- commitIntentConfigArgs,
1759
- getIntentCallsPayloads,
1263
+ commitIntent,
1264
+ commitIntentPending,
1265
+ commitIntentSuccess,
1266
+ commitIntentError,
1267
+ commitIntentArgs,
1268
+ executeIntent,
1269
+ executeIntentPending,
1270
+ executeIntentSuccess,
1271
+ executeIntentError,
1272
+ getIntent,
1760
1273
  operationHashes,
1761
1274
  callIntentCallsPayload,
1762
1275
  sendOriginTransaction,
@@ -1781,13 +1294,8 @@ export function useTrails(config: UseTrailsConfig): UseTrailsReturn {
1781
1294
  hasAutoExecuted,
1782
1295
  originCallSuccess: sendOriginTxn.isSuccess,
1783
1296
  sentMetaTxns,
1784
- sendMetaTxn,
1785
- sendMetaTxnPending,
1786
- sendMetaTxnSuccess,
1787
- sendMetaTxnError,
1788
- sendMetaTxnArgs,
1789
1297
  clearIntent,
1790
- metaTxnMonitorStatuses,
1298
+ intentReceiptStatus,
1791
1299
  createIntent,
1792
1300
  createIntentPending,
1793
1301
  createIntentSuccess,