@metamask/bridge-status-controller 69.0.0 → 70.0.1

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 (130) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/dist/bridge-status-controller.cjs +115 -354
  3. package/dist/bridge-status-controller.cjs.map +1 -1
  4. package/dist/bridge-status-controller.d.cts +3 -5
  5. package/dist/bridge-status-controller.d.cts.map +1 -1
  6. package/dist/bridge-status-controller.d.mts +3 -5
  7. package/dist/bridge-status-controller.d.mts.map +1 -1
  8. package/dist/bridge-status-controller.intent.cjs +12 -25
  9. package/dist/bridge-status-controller.intent.cjs.map +1 -1
  10. package/dist/bridge-status-controller.intent.d.cts +3 -14
  11. package/dist/bridge-status-controller.intent.d.cts.map +1 -1
  12. package/dist/bridge-status-controller.intent.d.mts +3 -14
  13. package/dist/bridge-status-controller.intent.d.mts.map +1 -1
  14. package/dist/bridge-status-controller.intent.mjs +12 -25
  15. package/dist/bridge-status-controller.intent.mjs.map +1 -1
  16. package/dist/bridge-status-controller.mjs +118 -357
  17. package/dist/bridge-status-controller.mjs.map +1 -1
  18. package/dist/index.cjs +1 -3
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +0 -1
  21. package/dist/index.d.cts.map +1 -1
  22. package/dist/index.d.mts +0 -1
  23. package/dist/index.d.mts.map +1 -1
  24. package/dist/index.mjs +0 -1
  25. package/dist/index.mjs.map +1 -1
  26. package/dist/types.cjs.map +1 -1
  27. package/dist/types.d.cts +11 -5
  28. package/dist/types.d.cts.map +1 -1
  29. package/dist/types.d.mts +11 -5
  30. package/dist/types.d.mts.map +1 -1
  31. package/dist/types.mjs.map +1 -1
  32. package/dist/utils/accounts.cjs +8 -0
  33. package/dist/utils/accounts.cjs.map +1 -0
  34. package/dist/utils/accounts.d.cts +36 -0
  35. package/dist/utils/accounts.d.cts.map +1 -0
  36. package/dist/utils/accounts.d.mts +36 -0
  37. package/dist/utils/accounts.d.mts.map +1 -0
  38. package/dist/utils/accounts.mjs +4 -0
  39. package/dist/utils/accounts.mjs.map +1 -0
  40. package/dist/utils/authentication.cjs +15 -0
  41. package/dist/utils/authentication.cjs.map +1 -0
  42. package/dist/utils/authentication.d.cts +3 -0
  43. package/dist/utils/authentication.d.cts.map +1 -0
  44. package/dist/utils/authentication.d.mts +3 -0
  45. package/dist/utils/authentication.d.mts.map +1 -0
  46. package/dist/utils/authentication.mjs +11 -0
  47. package/dist/utils/authentication.mjs.map +1 -0
  48. package/dist/utils/bridge-status.cjs +17 -1
  49. package/dist/utils/bridge-status.cjs.map +1 -1
  50. package/dist/utils/bridge-status.d.cts +8 -2
  51. package/dist/utils/bridge-status.d.cts.map +1 -1
  52. package/dist/utils/bridge-status.d.mts +8 -2
  53. package/dist/utils/bridge-status.d.mts.map +1 -1
  54. package/dist/utils/bridge-status.mjs +15 -0
  55. package/dist/utils/bridge-status.mjs.map +1 -1
  56. package/dist/utils/bridge.cjs +16 -0
  57. package/dist/utils/bridge.cjs.map +1 -0
  58. package/dist/utils/bridge.d.cts +10 -0
  59. package/dist/utils/bridge.d.cts.map +1 -0
  60. package/dist/utils/bridge.d.mts +10 -0
  61. package/dist/utils/bridge.d.mts.map +1 -0
  62. package/dist/utils/bridge.mjs +11 -0
  63. package/dist/utils/bridge.mjs.map +1 -0
  64. package/dist/utils/gas.cjs +1 -61
  65. package/dist/utils/gas.cjs.map +1 -1
  66. package/dist/utils/gas.d.cts +3 -26
  67. package/dist/utils/gas.d.cts.map +1 -1
  68. package/dist/utils/gas.d.mts +3 -26
  69. package/dist/utils/gas.d.mts.map +1 -1
  70. package/dist/utils/gas.mjs +0 -58
  71. package/dist/utils/gas.mjs.map +1 -1
  72. package/dist/utils/history.cjs +98 -0
  73. package/dist/utils/history.cjs.map +1 -0
  74. package/dist/utils/history.d.cts +22 -0
  75. package/dist/utils/history.d.cts.map +1 -0
  76. package/dist/utils/history.d.mts +22 -0
  77. package/dist/utils/history.d.mts.map +1 -0
  78. package/dist/utils/history.mjs +91 -0
  79. package/dist/utils/history.mjs.map +1 -0
  80. package/dist/utils/intent-api.cjs +41 -26
  81. package/dist/utils/intent-api.cjs.map +1 -1
  82. package/dist/utils/intent-api.d.cts +16 -3
  83. package/dist/utils/intent-api.d.cts.map +1 -1
  84. package/dist/utils/intent-api.d.mts +16 -3
  85. package/dist/utils/intent-api.d.mts.map +1 -1
  86. package/dist/utils/intent-api.mjs +38 -25
  87. package/dist/utils/intent-api.mjs.map +1 -1
  88. package/dist/utils/keyring.cjs +12 -0
  89. package/dist/utils/keyring.cjs.map +1 -0
  90. package/dist/utils/keyring.d.cts +8 -0
  91. package/dist/utils/keyring.d.cts.map +1 -0
  92. package/dist/utils/keyring.d.mts +8 -0
  93. package/dist/utils/keyring.d.mts.map +1 -0
  94. package/dist/utils/keyring.mjs +8 -0
  95. package/dist/utils/keyring.mjs.map +1 -0
  96. package/dist/utils/network.cjs +17 -0
  97. package/dist/utils/network.cjs.map +1 -0
  98. package/dist/utils/network.d.cts +5 -0
  99. package/dist/utils/network.d.cts.map +1 -0
  100. package/dist/utils/network.d.mts +5 -0
  101. package/dist/utils/network.d.mts.map +1 -0
  102. package/dist/utils/network.mjs +12 -0
  103. package/dist/utils/network.mjs.map +1 -0
  104. package/dist/utils/snaps.cjs +146 -1
  105. package/dist/utils/snaps.cjs.map +1 -1
  106. package/dist/utils/snaps.d.cts +48 -0
  107. package/dist/utils/snaps.d.cts.map +1 -1
  108. package/dist/utils/snaps.d.mts +48 -0
  109. package/dist/utils/snaps.d.mts.map +1 -1
  110. package/dist/utils/snaps.mjs +141 -0
  111. package/dist/utils/snaps.mjs.map +1 -1
  112. package/dist/utils/trace.cjs +31 -0
  113. package/dist/utils/trace.cjs.map +1 -0
  114. package/dist/utils/trace.d.cts +17 -0
  115. package/dist/utils/trace.d.cts.map +1 -0
  116. package/dist/utils/trace.d.mts +17 -0
  117. package/dist/utils/trace.d.mts.map +1 -0
  118. package/dist/utils/trace.mjs +26 -0
  119. package/dist/utils/trace.mjs.map +1 -0
  120. package/dist/utils/transaction.cjs +239 -184
  121. package/dist/utils/transaction.cjs.map +1 -1
  122. package/dist/utils/transaction.d.cts +85 -236
  123. package/dist/utils/transaction.d.cts.map +1 -1
  124. package/dist/utils/transaction.d.mts +85 -236
  125. package/dist/utils/transaction.d.mts.map +1 -1
  126. package/dist/utils/transaction.mjs +226 -176
  127. package/dist/utils/transaction.mjs.map +1 -1
  128. package/dist/utils/validators.d.cts +2 -2
  129. package/dist/utils/validators.d.mts +2 -2
  130. package/package.json +3 -3
@@ -1,196 +1,57 @@
1
- import type { AccountsControllerState } from "@metamask/accounts-controller";
2
- import type { Intent, QuoteMetadata, QuoteResponse, Trade, TxData } from "@metamask/bridge-controller";
1
+ import type { QuoteMetadata, QuoteResponse, TxData } from "@metamask/bridge-controller";
3
2
  import { TransactionType } from "@metamask/transaction-controller";
4
- import type { BatchTransactionParams, TransactionController, TransactionMeta } from "@metamask/transaction-controller";
5
- import type { BridgeStatusControllerMessenger, SolanaTransactionMeta } from "../types.mjs";
6
- import type { BridgeStatusControllerState } from "../types.mjs";
7
- export declare const generateActionId: () => string;
8
- export declare const getStatusRequestParams: (quoteResponse: QuoteResponse) => {
9
- bridgeId: string;
10
- bridge: string;
11
- srcChainId: number;
12
- destChainId: number;
13
- quote: {
14
- srcChainId: number;
15
- destChainId: number;
16
- srcAsset: {
17
- symbol: string;
18
- chainId: number;
19
- address: string;
20
- assetId: `${string}:${string}/${string}:${string}`;
21
- name: string;
22
- decimals: number;
23
- icon?: string | null | undefined;
24
- iconUrl?: string | null | undefined;
25
- };
26
- destAsset: {
27
- symbol: string;
28
- chainId: number;
29
- address: string;
30
- assetId: `${string}:${string}/${string}:${string}`;
31
- name: string;
32
- decimals: number;
33
- icon?: string | null | undefined;
34
- iconUrl?: string | null | undefined;
35
- };
36
- requestId: string;
37
- srcTokenAmount: string;
38
- destTokenAmount: string;
39
- minDestTokenAmount: string;
40
- feeData: {
41
- metabridge: {
42
- amount: string;
43
- asset: {
44
- symbol: string;
45
- chainId: number;
46
- address: string;
47
- assetId: `${string}:${string}/${string}:${string}`;
48
- name: string;
49
- decimals: number;
50
- icon?: string | null | undefined;
51
- iconUrl?: string | null | undefined;
52
- };
53
- };
54
- txFee?: ({
55
- amount: string;
56
- asset: {
57
- symbol: string;
58
- chainId: number;
59
- address: string;
60
- assetId: `${string}:${string}/${string}:${string}`;
61
- name: string;
62
- decimals: number;
63
- icon?: string | null | undefined;
64
- iconUrl?: string | null | undefined;
65
- };
66
- } & {
67
- maxFeePerGas: string;
68
- maxPriorityFeePerGas: string;
69
- }) | undefined;
70
- };
71
- bridgeId: string;
72
- bridges: string[];
73
- steps: {
74
- action: import("@metamask/bridge-controller").ActionTypes;
75
- srcChainId: number;
76
- srcAsset: {
77
- symbol: string;
78
- chainId: number;
79
- address: string;
80
- assetId: `${string}:${string}/${string}:${string}`;
81
- name: string;
82
- decimals: number;
83
- icon?: string | null | undefined;
84
- iconUrl?: string | null | undefined;
85
- };
86
- destAsset: {
87
- symbol: string;
88
- chainId: number;
89
- address: string;
90
- assetId: `${string}:${string}/${string}:${string}`;
91
- name: string;
92
- decimals: number;
93
- icon?: string | null | undefined;
94
- iconUrl?: string | null | undefined;
95
- };
96
- srcAmount: string;
97
- destAmount: string;
98
- protocol: {
99
- name: string;
100
- icon?: string | undefined;
101
- displayName?: string | undefined;
102
- };
103
- destChainId?: number | undefined;
104
- }[];
105
- refuel?: {
106
- action: import("@metamask/bridge-controller").ActionTypes;
107
- srcChainId: number;
108
- srcAsset: {
109
- symbol: string;
110
- chainId: number;
111
- address: string;
112
- assetId: `${string}:${string}/${string}:${string}`;
113
- name: string;
114
- decimals: number;
115
- icon?: string | null | undefined;
116
- iconUrl?: string | null | undefined;
117
- };
118
- destAsset: {
119
- symbol: string;
120
- chainId: number;
121
- address: string;
122
- assetId: `${string}:${string}/${string}:${string}`;
123
- name: string;
124
- decimals: number;
125
- icon?: string | null | undefined;
126
- iconUrl?: string | null | undefined;
127
- };
128
- srcAmount: string;
129
- destAmount: string;
130
- protocol: {
131
- name: string;
132
- icon?: string | undefined;
133
- displayName?: string | undefined;
134
- };
135
- destChainId?: number | undefined;
136
- } | undefined;
137
- gasIncluded?: boolean | undefined;
138
- gasIncluded7702?: boolean | undefined;
139
- priceData?: {
140
- totalFromAmountUsd?: string | undefined;
141
- totalToAmountUsd?: string | undefined;
142
- priceImpact?: string | undefined;
143
- totalFeeAmountUsd?: string | undefined;
144
- } | undefined;
145
- intent?: {
146
- protocol: string;
147
- order: {
148
- sellToken: string;
149
- buyToken: string;
150
- validTo: string | number;
151
- appData: string;
152
- appDataHash: string;
153
- feeAmount: string;
154
- kind: "sell" | "buy";
155
- partiallyFillable: boolean;
156
- receiver?: string | undefined;
157
- sellAmount?: string | undefined;
158
- buyAmount?: string | undefined;
159
- from?: string | undefined;
160
- };
161
- typedData: {
162
- types: Record<string, {
163
- name: string;
164
- type: string;
165
- }[]>;
166
- primaryType: string;
167
- domain: Record<string, any>;
168
- message: Record<string, any>;
169
- };
170
- settlementContract?: string | undefined;
171
- } | undefined;
172
- gasSponsored?: boolean | undefined;
173
- };
174
- refuel: boolean;
175
- };
176
- export declare const getTxMetaFields: (quoteResponse: Omit<QuoteResponse<Trade, Trade>, 'approval' | 'trade'> & QuoteMetadata, approvalTxId?: string) => Omit<TransactionMeta, 'networkClientId' | 'status' | 'time' | 'txParams' | 'id' | 'chainId'>;
3
+ import type { BatchTransactionParams, TransactionController, TransactionMeta, TransactionParams } from "@metamask/transaction-controller";
4
+ import { Hex } from "@metamask/utils";
5
+ import { BigNumber } from "bignumber.js";
6
+ import type { BridgeStatusControllerMessenger } from "../types.mjs";
7
+ export declare const getGasFeeEstimates: (messenger: BridgeStatusControllerMessenger, args: Parameters<TransactionController['estimateGasFee']>[0]) => Promise<{
8
+ maxFeePerGas?: string;
9
+ maxPriorityFeePerGas?: string;
10
+ }>;
177
11
  /**
178
- * Handles the response from non-EVM transaction submission
179
- * Works with the new unified ClientRequest:signAndSendTransaction interface
180
- * Supports Solana, Bitcoin, and other non-EVM chains
12
+ * Get the gas fee estimates for a transaction
181
13
  *
182
- * @param snapResponse - The response from the snap after transaction submission
183
- * @param quoteResponse - The quote response containing trade details and metadata
184
- * @param selectedAccount - The selected account information
185
- * @returns The transaction metadata including non-EVM specific fields
14
+ * @param messenger - The messenger for the gas fee estimates
15
+ * @param estimateGasFeeParams - The parameters for the {@link TransactionController.estimateGasFee} method
16
+
17
+ * @returns The gas fee estimates for the transaction
186
18
  */
187
- export declare const handleNonEvmTxResponse: (snapResponse: string | {
188
- transactionId: string;
19
+ export declare const getTxGasEstimates: (messenger: BridgeStatusControllerMessenger, estimateGasFeeParams: Parameters<TransactionController['estimateGasFee']>[0]) => Promise<{
20
+ baseAndPriorityFeePerGas: BigNumber | undefined;
21
+ maxFeePerGas: string | undefined;
22
+ maxPriorityFeePerGas: string | undefined;
23
+ }>;
24
+ export declare const calculateGasFees: (skipGasFields: boolean, messenger: BridgeStatusControllerMessenger, { chainId: _, gasLimit, ...trade }: TxData, networkClientId: string, chainId: Hex, txFee?: {
25
+ maxFeePerGas: string;
26
+ maxPriorityFeePerGas: string;
27
+ }) => Promise<{
28
+ maxFeePerGas?: undefined;
29
+ maxPriorityFeePerGas?: undefined;
30
+ gas?: undefined;
189
31
  } | {
190
- result: Record<string, string>;
32
+ gas: string | undefined;
33
+ maxFeePerGas: string;
34
+ maxPriorityFeePerGas: string;
191
35
  } | {
192
- signature: string;
193
- }, quoteResponse: Omit<QuoteResponse<Trade>, 'approval'> & QuoteMetadata, selectedAccount: AccountsControllerState['internalAccounts']['accounts'][string]) => TransactionMeta & SolanaTransactionMeta;
36
+ maxFeePerGas: string | undefined;
37
+ maxPriorityFeePerGas: string | undefined;
38
+ gas: `0x${string}`;
39
+ }>;
40
+ export declare const getTransactions: (messenger: BridgeStatusControllerMessenger) => TransactionMeta[];
41
+ export declare const getTransactionMetaById: (messenger: BridgeStatusControllerMessenger, txId?: string) => TransactionMeta | undefined;
42
+ export declare const getTransactionMetaByHash: (messenger: BridgeStatusControllerMessenger, txHash?: string) => TransactionMeta | undefined;
43
+ export declare const updateTransaction: (messenger: BridgeStatusControllerMessenger, txMeta: TransactionMeta, txMetaUpdates: Partial<TransactionMeta>, note: string) => void;
44
+ export declare const checkIsDelegatedAccount: (messenger: BridgeStatusControllerMessenger, fromAddress: Hex, chainIds: Hex[]) => Promise<boolean>;
45
+ export declare const addTransaction: (messenger: BridgeStatusControllerMessenger, txParams: TransactionParams, options: import("@metamask/transaction-controller").AddTransactionOptions) => Promise<TransactionMeta>;
46
+ export declare const generateActionId: () => string;
47
+ /**
48
+ * Adds a synthetic transaction to the TransactionController to display pending intent orders in the UI
49
+ *
50
+ * @param messenger - The messenger to use for the transaction
51
+ * @param args - The arguments for the transaction
52
+ * @returns The transaction meta
53
+ */
54
+ export declare const addSyntheticTransaction: (messenger: BridgeStatusControllerMessenger, txParams: TransactionParams, options: import("@metamask/transaction-controller").AddTransactionOptions) => Promise<TransactionMeta>;
194
55
  export declare const handleApprovalDelay: (srcChainId: QuoteResponse['quote']['srcChainId']) => Promise<void>;
195
56
  /**
196
57
  * Adds a delay for hardware wallet transactions on mobile to fix an issue
@@ -201,49 +62,30 @@ export declare const handleApprovalDelay: (srcChainId: QuoteResponse['quote']['s
201
62
  */
202
63
  export declare const handleMobileHardwareWalletDelay: (requireApproval: boolean) => Promise<void>;
203
64
  /**
204
- * Creates a request to sign and send a transaction for non-EVM chains
205
- * Uses the new unified ClientRequest:signAndSendTransaction interface
65
+ * Waits until a given transaction (by id) reaches confirmed/finalized status or fails/times out.
206
66
  *
207
- * @param trade - The trade data
208
- * @param srcChainId - The source chain ID
209
- * @param selectedAccount - The selected account information
210
- * @returns The snap request object for signing and sending transaction
67
+ * @deprecated use addTransaction util
68
+ * @param messenger - the BridgeStatusControllerMessenger
69
+ * @param txId - the transaction ID
70
+ * @param options - the options for the timeout and poll
71
+ * @param options.timeoutMs - the timeout in milliseconds
72
+ * @param options.pollMs - the poll interval in milliseconds
73
+ * @returns the transaction meta
211
74
  */
212
- export declare const getClientRequest: (trade: Trade, srcChainId: number, selectedAccount: AccountsControllerState['internalAccounts']['accounts'][string]) => {
213
- snapId: never;
214
- origin: string;
215
- handler: never;
216
- request: {
217
- id: string;
218
- jsonrpc: string;
219
- method: string;
220
- params: {
221
- options?: Record<string, unknown> | undefined;
222
- transaction: string;
223
- scope: `${string}:${string}`;
224
- accountId: string;
225
- };
226
- };
227
- };
228
75
  export declare const waitForTxConfirmation: (messenger: BridgeStatusControllerMessenger, txId: string, { timeoutMs, pollMs, }?: {
229
76
  timeoutMs?: number | undefined;
230
77
  pollMs?: number | undefined;
231
78
  }) => Promise<TransactionMeta>;
232
- export declare const rekeyHistoryItemInState: (state: BridgeStatusControllerState, actionId: string, txMeta: {
233
- id: string;
234
- hash?: string;
235
- }) => boolean;
236
79
  export declare const toBatchTxParams: (skipGasFields: boolean, { chainId, gasLimit, ...trade }: TxData, { maxFeePerGas, maxPriorityFeePerGas, gas, }: {
237
80
  maxFeePerGas?: string | undefined;
238
81
  maxPriorityFeePerGas?: string | undefined;
239
82
  gas?: string | undefined;
240
83
  }) => BatchTransactionParams;
241
- export declare const getAddTransactionBatchParams: ({ messenger, isBridgeTx, approval, resetApproval, trade, quoteResponse: { quote: { feeData: { txFee }, gasIncluded, gasIncluded7702, gasSponsored, }, sentAmount, toTokenAmount, }, requireApproval, isDelegatedAccount, estimateGasFeeFn, }: {
84
+ export declare const getAddTransactionBatchParams: ({ messenger, isBridgeTx, approval, resetApproval, trade, quoteResponse: { quote: { feeData: { txFee }, gasIncluded, gasIncluded7702, gasSponsored, }, sentAmount, toTokenAmount, }, requireApproval, isDelegatedAccount, }: {
242
85
  messenger: BridgeStatusControllerMessenger;
243
86
  isBridgeTx: boolean;
244
87
  trade: TxData;
245
88
  quoteResponse: Omit<QuoteResponse, 'approval' | 'trade'> & Partial<QuoteMetadata>;
246
- estimateGasFeeFn: typeof TransactionController.prototype.estimateGasFee;
247
89
  approval?: {
248
90
  chainId: number;
249
91
  from: string;
@@ -265,9 +107,8 @@ export declare const getAddTransactionBatchParams: ({ messenger, isBridgeTx, app
265
107
  requireApproval?: boolean | undefined;
266
108
  isDelegatedAccount?: boolean | undefined;
267
109
  }) => Promise<import("@metamask/transaction-controller").TransactionBatchRequest>;
268
- export declare const findAndUpdateTransactionsInBatch: ({ messenger, updateTransactionFn, batchId, txDataByType, }: {
110
+ export declare const findAndUpdateTransactionsInBatch: ({ messenger, batchId, txDataByType, }: {
269
111
  messenger: BridgeStatusControllerMessenger;
270
- updateTransactionFn: typeof TransactionController.prototype.updateTransaction;
271
112
  batchId: string;
272
113
  txDataByType: {
273
114
  batch?: string | undefined;
@@ -288,6 +129,7 @@ export declare const findAndUpdateTransactionsInBatch: ({ messenger, updateTrans
288
129
  perpsDeposit?: string | undefined;
289
130
  perpsDepositAndOrder?: string | undefined;
290
131
  perpsRelayDeposit?: string | undefined;
132
+ perpsWithdraw?: string | undefined;
291
133
  personal_sign?: string | undefined;
292
134
  predictAcrossDeposit?: string | undefined;
293
135
  predictBuy?: string | undefined;
@@ -321,26 +163,33 @@ export declare const findAndUpdateTransactionsInBatch: ({ messenger, updateTrans
321
163
  approvalMeta?: TransactionMeta | undefined;
322
164
  tradeMeta?: TransactionMeta | undefined;
323
165
  };
166
+ export declare const addTransactionBatch: (messenger: BridgeStatusControllerMessenger, addTransactionBatchFn: TransactionController['addTransactionBatch'], request: import("@metamask/transaction-controller").TransactionBatchRequest) => Promise<{
167
+ approvalMeta: TransactionMeta | undefined;
168
+ tradeMeta: TransactionMeta;
169
+ }>;
324
170
  /**
325
- * Determines the key to use for storing a bridge history item.
326
- * Uses actionId for pre-submission tracking, or bridgeTxMetaId for post-submission.
171
+ * Submits an EVM transaction to the TransactionController
327
172
  *
328
- * @param actionId - The action ID used for pre-submission tracking
329
- * @param bridgeTxMetaId - The transaction meta ID from bridgeTxMeta
330
- * @returns The key to use for the history item
331
- * @throws Error if neither actionId nor bridgeTxMetaId is provided
173
+ * @param params - The parameters for the transaction
174
+ * @param params.transactionType - The type of transaction to submit
175
+ * @param params.trade - The trade data to confirm
176
+ * @param params.requireApproval - Whether to require approval for the transaction
177
+ * @param params.txFee - Optional gas fee parameters from the quote (used when gasIncluded is true)
178
+ * @param params.txFee.maxFeePerGas - The maximum fee per gas from the quote
179
+ * @param params.txFee.maxPriorityFeePerGas - The maximum priority fee per gas from the quote
180
+ * @param params.actionId - Optional actionId for pre-submission history (if not provided, one is generated)
181
+ * @param params.messenger - The messenger to use for the transaction
182
+ * @returns The transaction meta
332
183
  */
333
- export declare function getHistoryKey(actionId: string | undefined, bridgeTxMetaId: string | undefined): string;
334
- /**
335
- * Extracts and validates the intent data from a quote response.
336
- *
337
- * @param quoteResponse - The quote response that may contain intent data
338
- * @returns The intent data from the quote
339
- * @throws Error if the quote does not contain intent data
340
- */
341
- export declare function getIntentFromQuote(quoteResponse: QuoteResponse & {
342
- quote: {
343
- intent?: Intent;
344
- };
345
- }): Intent;
184
+ export declare const submitEvmTransaction: ({ messenger, trade, transactionType, requireApproval, txFee, actionId, }: {
185
+ messenger: BridgeStatusControllerMessenger;
186
+ transactionType: TransactionType;
187
+ trade: TxData;
188
+ requireApproval?: boolean | undefined;
189
+ txFee?: {
190
+ maxFeePerGas: string;
191
+ maxPriorityFeePerGas: string;
192
+ } | undefined;
193
+ actionId?: string | undefined;
194
+ }) => Promise<TransactionMeta>;
346
195
  //# sourceMappingURL=transaction.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transaction.d.mts","sourceRoot":"","sources":["../../src/utils/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,sCAAsC;AAS7E,OAAO,KAAK,EACV,MAAM,EACN,aAAa,EACb,aAAa,EACb,KAAK,EACL,MAAM,EACP,oCAAoC;AAErC,OAAO,EAEL,eAAe,EAChB,yCAAyC;AAC1C,OAAO,KAAK,EACV,sBAAsB,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