@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.
- package/CHANGELOG.md +22 -1
- package/dist/bridge-status-controller.cjs +115 -354
- package/dist/bridge-status-controller.cjs.map +1 -1
- package/dist/bridge-status-controller.d.cts +3 -5
- package/dist/bridge-status-controller.d.cts.map +1 -1
- package/dist/bridge-status-controller.d.mts +3 -5
- package/dist/bridge-status-controller.d.mts.map +1 -1
- package/dist/bridge-status-controller.intent.cjs +12 -25
- package/dist/bridge-status-controller.intent.cjs.map +1 -1
- package/dist/bridge-status-controller.intent.d.cts +3 -14
- package/dist/bridge-status-controller.intent.d.cts.map +1 -1
- package/dist/bridge-status-controller.intent.d.mts +3 -14
- package/dist/bridge-status-controller.intent.d.mts.map +1 -1
- package/dist/bridge-status-controller.intent.mjs +12 -25
- package/dist/bridge-status-controller.intent.mjs.map +1 -1
- package/dist/bridge-status-controller.mjs +118 -357
- package/dist/bridge-status-controller.mjs.map +1 -1
- package/dist/index.cjs +1 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +0 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +11 -5
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +11 -5
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/dist/utils/accounts.cjs +8 -0
- package/dist/utils/accounts.cjs.map +1 -0
- package/dist/utils/accounts.d.cts +36 -0
- package/dist/utils/accounts.d.cts.map +1 -0
- package/dist/utils/accounts.d.mts +36 -0
- package/dist/utils/accounts.d.mts.map +1 -0
- package/dist/utils/accounts.mjs +4 -0
- package/dist/utils/accounts.mjs.map +1 -0
- package/dist/utils/authentication.cjs +15 -0
- package/dist/utils/authentication.cjs.map +1 -0
- package/dist/utils/authentication.d.cts +3 -0
- package/dist/utils/authentication.d.cts.map +1 -0
- package/dist/utils/authentication.d.mts +3 -0
- package/dist/utils/authentication.d.mts.map +1 -0
- package/dist/utils/authentication.mjs +11 -0
- package/dist/utils/authentication.mjs.map +1 -0
- package/dist/utils/bridge-status.cjs +17 -1
- package/dist/utils/bridge-status.cjs.map +1 -1
- package/dist/utils/bridge-status.d.cts +8 -2
- package/dist/utils/bridge-status.d.cts.map +1 -1
- package/dist/utils/bridge-status.d.mts +8 -2
- package/dist/utils/bridge-status.d.mts.map +1 -1
- package/dist/utils/bridge-status.mjs +15 -0
- package/dist/utils/bridge-status.mjs.map +1 -1
- package/dist/utils/bridge.cjs +16 -0
- package/dist/utils/bridge.cjs.map +1 -0
- package/dist/utils/bridge.d.cts +10 -0
- package/dist/utils/bridge.d.cts.map +1 -0
- package/dist/utils/bridge.d.mts +10 -0
- package/dist/utils/bridge.d.mts.map +1 -0
- package/dist/utils/bridge.mjs +11 -0
- package/dist/utils/bridge.mjs.map +1 -0
- package/dist/utils/gas.cjs +1 -61
- package/dist/utils/gas.cjs.map +1 -1
- package/dist/utils/gas.d.cts +3 -26
- package/dist/utils/gas.d.cts.map +1 -1
- package/dist/utils/gas.d.mts +3 -26
- package/dist/utils/gas.d.mts.map +1 -1
- package/dist/utils/gas.mjs +0 -58
- package/dist/utils/gas.mjs.map +1 -1
- package/dist/utils/history.cjs +98 -0
- package/dist/utils/history.cjs.map +1 -0
- package/dist/utils/history.d.cts +22 -0
- package/dist/utils/history.d.cts.map +1 -0
- package/dist/utils/history.d.mts +22 -0
- package/dist/utils/history.d.mts.map +1 -0
- package/dist/utils/history.mjs +91 -0
- package/dist/utils/history.mjs.map +1 -0
- package/dist/utils/intent-api.cjs +41 -26
- package/dist/utils/intent-api.cjs.map +1 -1
- package/dist/utils/intent-api.d.cts +16 -3
- package/dist/utils/intent-api.d.cts.map +1 -1
- package/dist/utils/intent-api.d.mts +16 -3
- package/dist/utils/intent-api.d.mts.map +1 -1
- package/dist/utils/intent-api.mjs +38 -25
- package/dist/utils/intent-api.mjs.map +1 -1
- package/dist/utils/keyring.cjs +12 -0
- package/dist/utils/keyring.cjs.map +1 -0
- package/dist/utils/keyring.d.cts +8 -0
- package/dist/utils/keyring.d.cts.map +1 -0
- package/dist/utils/keyring.d.mts +8 -0
- package/dist/utils/keyring.d.mts.map +1 -0
- package/dist/utils/keyring.mjs +8 -0
- package/dist/utils/keyring.mjs.map +1 -0
- package/dist/utils/network.cjs +17 -0
- package/dist/utils/network.cjs.map +1 -0
- package/dist/utils/network.d.cts +5 -0
- package/dist/utils/network.d.cts.map +1 -0
- package/dist/utils/network.d.mts +5 -0
- package/dist/utils/network.d.mts.map +1 -0
- package/dist/utils/network.mjs +12 -0
- package/dist/utils/network.mjs.map +1 -0
- package/dist/utils/snaps.cjs +146 -1
- package/dist/utils/snaps.cjs.map +1 -1
- package/dist/utils/snaps.d.cts +48 -0
- package/dist/utils/snaps.d.cts.map +1 -1
- package/dist/utils/snaps.d.mts +48 -0
- package/dist/utils/snaps.d.mts.map +1 -1
- package/dist/utils/snaps.mjs +141 -0
- package/dist/utils/snaps.mjs.map +1 -1
- package/dist/utils/trace.cjs +31 -0
- package/dist/utils/trace.cjs.map +1 -0
- package/dist/utils/trace.d.cts +17 -0
- package/dist/utils/trace.d.cts.map +1 -0
- package/dist/utils/trace.d.mts +17 -0
- package/dist/utils/trace.d.mts.map +1 -0
- package/dist/utils/trace.mjs +26 -0
- package/dist/utils/trace.mjs.map +1 -0
- package/dist/utils/transaction.cjs +239 -184
- package/dist/utils/transaction.cjs.map +1 -1
- package/dist/utils/transaction.d.cts +85 -236
- package/dist/utils/transaction.d.cts.map +1 -1
- package/dist/utils/transaction.d.mts +85 -236
- package/dist/utils/transaction.d.mts.map +1 -1
- package/dist/utils/transaction.mjs +226 -176
- package/dist/utils/transaction.mjs.map +1 -1
- package/dist/utils/validators.d.cts +2 -2
- package/dist/utils/validators.d.mts +2 -2
- package/package.json +3 -3
|
@@ -1,196 +1,57 @@
|
|
|
1
|
-
import type {
|
|
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
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
export declare const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
*
|
|
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
|
|
183
|
-
* @param
|
|
184
|
-
|
|
185
|
-
* @returns The
|
|
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
|
|
188
|
-
|
|
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
|
-
|
|
32
|
+
gas: string | undefined;
|
|
33
|
+
maxFeePerGas: string;
|
|
34
|
+
maxPriorityFeePerGas: string;
|
|
191
35
|
} | {
|
|
192
|
-
|
|
193
|
-
|
|
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
|
-
*
|
|
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
|
-
* @
|
|
208
|
-
* @param
|
|
209
|
-
* @param
|
|
210
|
-
* @
|
|
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,
|
|
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,
|
|
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
|
-
*
|
|
326
|
-
* Uses actionId for pre-submission tracking, or bridgeTxMetaId for post-submission.
|
|
171
|
+
* Submits an EVM transaction to the TransactionController
|
|
327
172
|
*
|
|
328
|
-
* @param
|
|
329
|
-
* @param
|
|
330
|
-
* @
|
|
331
|
-
* @
|
|
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
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
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":"
|
|
1
|
+
{"version":3,"file":"transaction.d.mts","sourceRoot":"","sources":["../../src/utils/transaction.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,MAAM,EACP,oCAAoC;AAErC,OAAO,EAEL,eAAe,EAChB,yCAAyC;AAC1C,OAAO,KAAK,EACV,sBAAsB,EAEtB,qBAAqB,EACrB,eAAe,EAEf,iBAAiB,EAClB,yCAAyC;AAC1C,OAAO,EAAuB,GAAG,EAAE,wBAAwB;AAC3D,OAAO,EAAE,SAAS,EAAE,qBAAqB;AAKzC,OAAO,KAAK,EAAE,+BAA+B,EAAE,qBAAiB;AAEhE,eAAO,MAAM,kBAAkB,qDAEvB,WAAW,qBAAqB,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,KAC3D,QAAQ;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAAE,CAclE,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,qEAEN,WAAW,qBAAqB,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;;;;EA4B7E,CAAC;AAEF,eAAO,MAAM,gBAAgB,kBACZ,OAAO,kFAEc,MAAM,mBACzB,MAAM,WACd,GAAG,UACJ;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,oBAAoB,EAAE,MAAM,CAAA;CAAE;;;;;;kBAAtC,MAAM;0BAAwB,MAAM;;;;;EA8B7D,CAAC;AAEF,eAAO,MAAM,eAAe,mEAE3B,CAAC;AAEF,eAAO,MAAM,sBAAsB,sDAE1B,MAAM,gCAKd,CAAC;AAEF,eAAO,MAAM,wBAAwB,wDAE1B,MAAM,gCAKhB,CAAC;AAEF,eAAO,MAAM,iBAAiB,uDAEpB,eAAe,iBACR,QAAQ,eAAe,CAAC,QACjC,MAAM,SAOb,CAAC;AAEF,eAAO,MAAM,uBAAuB,4DAErB,GAAG,YACN,GAAG,EAAE,KACd,QAAQ,OAAO,CAgBjB,CAAC;AAkBF,eAAO,MAAM,cAAc,kLAS1B,CAAC;AAEF,eAAO,MAAM,gBAAgB,cAAgD,CAAC;AAE9E;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,kLAenC,CAAC;AAEF,eAAO,MAAM,mBAAmB,eAClB,aAAa,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,kBAYjD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B,oBACzB,OAAO,kBAQzB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,qDAE1B,MAAM;;;MAKX,QAAQ,eAAe,CAwBzB,CAAC;AAEF,eAAO,MAAM,eAAe,kBACX,OAAO,mCACW,MAAM;;;;MAMtC,sBAiBF,CAAC;AAEF,eAAO,MAAM,4BAA4B;;gBAoB3B,OAAO;WACZ,MAAM;mBACE,KAAK,aAAa,EAAE,UAAU,GAAG,OAAO,CAAC,GACtD,QAAQ,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;iFA4FzB,CAAC;AAEF,eAAO,MAAM,gCAAgC;;aAMlC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4EhB,CAAC;AAEF,eAAO,MAAM,mBAAmB,sEAEP,qBAAqB,CAAC,qBAAqB,CAAC;;;EAiCpE,CAAC;AAyCF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB;;qBAUd,eAAe;WACzB,MAAM;;;sBAEW,MAAM;8BAAwB,MAAM;;;MAE1D,QAAQ,eAAe,CAgD1B,CAAC"}
|