@metamask/transaction-controller 18.2.0 → 18.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.
- package/CHANGELOG.md +362 -0
- package/dist/TransactionController.d.ts +8 -4
- package/dist/TransactionController.d.ts.map +1 -1
- package/dist/TransactionController.js +15 -3
- package/dist/TransactionController.js.map +1 -1
- package/package.json +2 -2
- package/dist/EtherscanRemoteTransactionSource.d.ts +0 -15
- package/dist/EtherscanRemoteTransactionSource.d.ts.map +0 -1
- package/dist/EtherscanRemoteTransactionSource.js +0 -122
- package/dist/EtherscanRemoteTransactionSource.js.map +0 -1
- package/dist/IncomingTransactionHelper.d.ts +0 -25
- package/dist/IncomingTransactionHelper.d.ts.map +0 -1
- package/dist/IncomingTransactionHelper.js +0 -198
- package/dist/IncomingTransactionHelper.js.map +0 -1
- package/dist/etherscan.d.ts +0 -64
- package/dist/etherscan.d.ts.map +0 -1
- package/dist/etherscan.js +0 -109
- package/dist/etherscan.js.map +0 -1
- package/dist/external-transactions.d.ts +0 -10
- package/dist/external-transactions.d.ts.map +0 -1
- package/dist/external-transactions.js +0 -36
- package/dist/external-transactions.js.map +0 -1
- package/dist/history.d.ts +0 -15
- package/dist/history.d.ts.map +0 -1
- package/dist/history.js +0 -75
- package/dist/history.js.map +0 -1
- package/dist/mocks/txsMock.d.ts +0 -64
- package/dist/mocks/txsMock.d.ts.map +0 -1
- package/dist/mocks/txsMock.js +0 -515
- package/dist/mocks/txsMock.js.map +0 -1
- package/dist/transaction-type.d.ts +0 -14
- package/dist/transaction-type.d.ts.map +0 -1
- package/dist/transaction-type.js +0 -114
- package/dist/transaction-type.js.map +0 -1
- package/dist/utils.d.ts +0 -72
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -235
- package/dist/utils.js.map +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
All notable changes to this project will be documented in this file.
|
|
3
|
+
|
|
4
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
5
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [18.3.0]
|
|
10
|
+
### Added
|
|
11
|
+
- Add optional `getExternalPendingTransactions` callback argument to constructor ([#3587](https://github.com/MetaMask/core/pull/3587))
|
|
12
|
+
|
|
13
|
+
## [18.2.0]
|
|
14
|
+
### Added
|
|
15
|
+
- Add the `customNonceValue` property to the transaction metadata ([#3579](https://github.com/MetaMask/core/pull/3579))
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
- Update transaction metadata after approval if the approval result includes the `value.txMeta` property ([#3579](https://github.com/MetaMask/core/pull/3579))
|
|
19
|
+
- Add `type` property to all incoming transactions ([#3579](https://github.com/MetaMask/core/pull/3579))
|
|
20
|
+
|
|
21
|
+
## [18.1.0]
|
|
22
|
+
### Added
|
|
23
|
+
- Add `cancelMultiplier` and `speedUpMultiplier` constructor arguments to optionally override the default multipliers of `1.5` and `1.1` respectively ([#2678](https://github.com/MetaMask/core/pull/2678))
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
- Populate the `preTxBalance` property before publishing transactions with the `swap` type ([#2678](https://github.com/MetaMask/core/pull/2678))
|
|
27
|
+
- Change the status of transactions with matching nonces to `dropped` when confirming a transaction ([#2678](https://github.com/MetaMask/core/pull/2678))
|
|
28
|
+
|
|
29
|
+
## [18.0.0]
|
|
30
|
+
### Added
|
|
31
|
+
- Add `updateEditableParams` method ([#2056](https://github.com/MetaMask/core/pull/2056))
|
|
32
|
+
- Add `initApprovals` method to trigger the approval flow for any pending transactions during initialisation ([#2056](https://github.com/MetaMask/core/pull/2056))
|
|
33
|
+
- Add `getTransactions` method to search transactions using the given criteria and options ([#2056](https://github.com/MetaMask/core/pull/2056))
|
|
34
|
+
|
|
35
|
+
### Changed
|
|
36
|
+
- **BREAKING:** Bump `@metamask/base-controller` to ^4.0.0 ([#2063](https://github.com/MetaMask/core/pull/2063))
|
|
37
|
+
- This is breaking because the type of the `messenger` has backward-incompatible changes. See the changelog for this package for more.
|
|
38
|
+
- **BREAKING:** Add `finished` and `publish-skip` events to `Events` type
|
|
39
|
+
- **BREAKING:** Update `TransactionReceipt` type so `transactionIndex` is now a string rather than a number ([#2063](https://github.com/MetaMask/core/pull/2063))
|
|
40
|
+
- Bump `nonce-tracker` to ^3.0.0 ([#2040](https://github.com/MetaMask/core/pull/2040))
|
|
41
|
+
- The controller now emits a `transaction-status-update` event each time the status of a transaction changes (e.g. submitted, rejected, etc.) ([#2027](https://github.com/MetaMask/core/pull/2027))
|
|
42
|
+
- Make `getCurrentAccountEIP1559Compatibility` constructor parameter optional ([#2056](https://github.com/MetaMask/core/pull/2056))
|
|
43
|
+
- Normalize the gas values provided to the `speedUpTransaction` and `stopTransaction` methods ([#2056](https://github.com/MetaMask/core/pull/2056))
|
|
44
|
+
- Persist any property changes performed by the `afterSign` hook ([#2056](https://github.com/MetaMask/core/pull/2056))
|
|
45
|
+
- Report success to the approver if publishing is skipped by the `beforePublish` hook ([#2056](https://github.com/MetaMask/core/pull/2056))
|
|
46
|
+
- Update `postTxBalance` after all swap transactions ([#2056](https://github.com/MetaMask/core/pull/2056))
|
|
47
|
+
- Bump `@metamask/approval-controller` to ^5.0.0 ([#2063](https://github.com/MetaMask/core/pull/2063))
|
|
48
|
+
- Bump `@metamask/controller-utils` to ^6.0.0 ([#2063](https://github.com/MetaMask/core/pull/2063))
|
|
49
|
+
- Bump `@metamask/gas-fee-controller` to ^11.0.0 ([#2063](https://github.com/MetaMask/core/pull/2063))
|
|
50
|
+
- Bump `@metamask/network-controller` to ^17.0.0 ([#2063](https://github.com/MetaMask/core/pull/2063))
|
|
51
|
+
|
|
52
|
+
## [17.0.0]
|
|
53
|
+
### Added
|
|
54
|
+
- **BREAKING:** Add additional support swaps support ([#1877](https://github.com/MetaMask/core/pull/1877))
|
|
55
|
+
- Swap transaction updates can be prevented by setting `disableSwaps` as `true`. If not set it will default to `false`.
|
|
56
|
+
- If `disableSwaps` is `false` or not set, then the `createSwapsTransaction` callback MUST be defined.
|
|
57
|
+
- Add optional hooks to support alternate flows ([#1787](https://github.com/MetaMask/core/pull/1787))
|
|
58
|
+
- Add the `getAdditionalSignArguments` hook to provide additional arguments when signing.
|
|
59
|
+
- Add the `beforeApproveOnInit` hook to execute additional logic before starting an approval flow for a transaction during initialization. Return `false` to skip the transaction.
|
|
60
|
+
- Add the `afterSign` hook to execute additional logic after signing a transaction. Return `false` to not change the `status` to `signed`.
|
|
61
|
+
- Add the `beforePublish` hook to execute additional logic before publishing a transaction. Return `false` to prevent the transaction being submitted.
|
|
62
|
+
- Add additional persisted transaction support during initialization and on network change ([#1916](https://github.com/MetaMask/core/pull/1916))
|
|
63
|
+
- Initialise approvals for unapproved transactions on the current network.
|
|
64
|
+
- Add missing gas values for unapproved transactions on the current network.
|
|
65
|
+
- Submit any approved transactions on the current network.
|
|
66
|
+
- Support saved gas fees ([#1966](https://github.com/MetaMask/core/pull/1966))
|
|
67
|
+
- Add optional `getSavedGasFees` callback to constructor.
|
|
68
|
+
- Add `updateCustodialTransaction` method to update custodial transactions ([#2018](https://github.com/MetaMask/core/pull/2018))
|
|
69
|
+
- Add `accessList` to txParam types ([#2016](https://github.com/MetaMask/core/pull/2016))
|
|
70
|
+
- Add `estimateGasBuffered` method to estimate gas and apply a specific buffer multiplier ([#2021](https://github.com/MetaMask/core/pull/2021))
|
|
71
|
+
- Add `updateSecurityAlertResponse` method ([#1985](https://github.com/MetaMask/core/pull/1985))
|
|
72
|
+
- Add gas values validation ([#1978](https://github.com/MetaMask/core/pull/1978))
|
|
73
|
+
- Add `approveTransactionsWithSameNonce` method ([#1961](https://github.com/MetaMask/core/pull/1961))
|
|
74
|
+
- Add `clearUnapprovedTransactions` method ([#1979](https://github.com/MetaMask/core/pull/1979))
|
|
75
|
+
- Add `updatePreviousGasParams` method ([#1943](https://github.com/MetaMask/core/pull/1943))
|
|
76
|
+
- Emit additional events to support metrics in the clients ([#1894](https://github.com/MetaMask/core/pull/1894))
|
|
77
|
+
- Populate the `firstRetryBlockNumber`, `retryCount`, and `warning` properties in the transaction metadata. ([#1896](https://github.com/MetaMask/core/pull/1896))
|
|
78
|
+
|
|
79
|
+
### Changed
|
|
80
|
+
- **BREAKING:** Pending transactions are now automatically resubmitted. ([#1896](https://github.com/MetaMask/core/pull/1896))
|
|
81
|
+
- This can be disabled by setting the new `pendingTransactions.isResubmitEnabled` constructor option to `false`.
|
|
82
|
+
- **BREAKING:** Bump dependency and peer dependency on `@metamask/network-controller` to ^16.0.0
|
|
83
|
+
- Persist specific error properties in core transaction metadata ([#1915](https://github.com/MetaMask/core/pull/1915))
|
|
84
|
+
- Create `TransactionError` type with explicit properties.
|
|
85
|
+
- Align core transaction error messages with extension ([#1980](https://github.com/MetaMask/core/pull/1980))
|
|
86
|
+
- Catch of the `initApprovals` method to skip logging when the error is `userRejectedRequest`.
|
|
87
|
+
- Create an additional transaction metadata entry when calling `stopTransaction` ([#1998](https://github.com/MetaMask/core/pull/1998))
|
|
88
|
+
- Bump dependency `@metamask/eth-query` from ^3.0.1 to ^4.0.0 ([#2028](https://github.com/MetaMask/core/pull/2028))
|
|
89
|
+
- Bump dependency and peer dependency on `@metamask/gas-fee-controller` to ^10.0.1
|
|
90
|
+
- Bump @metamask/utils from 8.1.0 to 8.2.0 ([#1957](https://github.com/MetaMask/core/pull/1957))
|
|
91
|
+
|
|
92
|
+
## [16.0.0]
|
|
93
|
+
### Changed
|
|
94
|
+
- **BREAKING:** Bump dependency and peer dependency on `@metamask/gas-fee-controller` to ^10.0.0
|
|
95
|
+
- Bump dependency and peer dependency on `@metamask/network-controller` to ^15.1.0
|
|
96
|
+
|
|
97
|
+
## [15.0.0]
|
|
98
|
+
### Changed
|
|
99
|
+
- **BREAKING:** Bump dependency and peer dependency on `@metamask/network-controller` to ^15.0.0
|
|
100
|
+
- Bump dependency on `@metamask/rpc-errors` to ^6.1.0 ([#1653](https://github.com/MetaMask/core/pull/1653))
|
|
101
|
+
- Bump dependency and peer dependency on `@metamask/approval-controller` to ^4.0.1
|
|
102
|
+
|
|
103
|
+
## [14.0.0]
|
|
104
|
+
### Added
|
|
105
|
+
- **BREAKING:** Add required `getPermittedAccounts` argument to constructor, used to validate `from` addresses ([#1722](https://github.com/MetaMask/core/pull/1722))
|
|
106
|
+
- Add `securityProviderRequest` option to constructor ([#1725](https://github.com/MetaMask/core/pull/1725))
|
|
107
|
+
- Add `method` option to `addTransaction` method ([#1725](https://github.com/MetaMask/core/pull/1725))
|
|
108
|
+
- Add `securityProviderRequest` property to TransactionMetaBase ([#1725](https://github.com/MetaMask/core/pull/1725))
|
|
109
|
+
- Add SecurityProviderRequest type ([#1725](https://github.com/MetaMask/core/pull/1725))
|
|
110
|
+
- Update `addTransaction` to set `securityProviderRequest` on transaction metadata when requested to do so ([#1725](https://github.com/MetaMask/core/pull/1725))
|
|
111
|
+
- Update `txParams` validation to validate `chainId` ([#1723](https://github.com/MetaMask/core/pull/1723))
|
|
112
|
+
- Update `addTransaction` to ensure allowed `from` address when `origin` is specified ([#1722](https://github.com/MetaMask/core/pull/1722))
|
|
113
|
+
|
|
114
|
+
### Changed
|
|
115
|
+
- Bump dependency on `@metamask/utils` to ^8.1.0 ([#1639](https://github.com/MetaMask/core/pull/1639))
|
|
116
|
+
- Bump dependency and peer dependency on `@metamask/approval-controller` to ^4.0.0
|
|
117
|
+
- Bump dependency on `@metamask/base-controller` to ^3.2.3
|
|
118
|
+
- Bump dependency on `@metamask/controller-utils` to ^5.0.2
|
|
119
|
+
- Bump dependency and peer dependency on `@metamask/network-controller` to ^14.0.0
|
|
120
|
+
|
|
121
|
+
### Removed
|
|
122
|
+
- **BREAKING:** Remove `interval` config option ([#1746](https://github.com/MetaMask/core/pull/1746))
|
|
123
|
+
- The block tracker (which has its own interval) is now used to poll for pending transactions instead.
|
|
124
|
+
- **BREAKING:** Remove `poll` method ([#1746](https://github.com/MetaMask/core/pull/1746))
|
|
125
|
+
- The block tracker is assumed to be running, TransactionController does not offer a way to stop it.
|
|
126
|
+
- **BREAKING:** Remove `queryTransactionStatuses` method ([#1746](https://github.com/MetaMask/core/pull/1746))
|
|
127
|
+
- This functionality has been moved to a private interface and there is no way to use it externally.
|
|
128
|
+
|
|
129
|
+
## [13.0.0]
|
|
130
|
+
### Changed
|
|
131
|
+
- **BREAKING**: Add required `getCurrentAccountEIP1559Compatibility` and `getCurrentNetworkEIP1559Compatibility` callback arguments to constructor ([#1693](https://github.com/MetaMask/core/pull/1693))
|
|
132
|
+
- Update `validateTxParams` to throw standardised errors using the `@metamask/rpc-errors` package ([#1690](https://github.com/MetaMask/core/pull/1690))
|
|
133
|
+
- The dependency `eth-rpc-errors` has been replaced by `@metamask/rpc-errors`
|
|
134
|
+
- Preserve `type` transaction parameter for legacy transactions ([#1713](https://github.com/MetaMask/core/pull/1713))
|
|
135
|
+
- Update TypeScript to v4.8.x ([#1718](https://github.com/MetaMask/core/pull/1718))
|
|
136
|
+
|
|
137
|
+
## [12.0.0]
|
|
138
|
+
### Changed
|
|
139
|
+
- **BREAKING**: Use only `chainId` to determine if a transaction belongs to the current network ([#1633](https://github.com/MetaMask/core/pull/1633))
|
|
140
|
+
- No longer uses `networkID` as a fallback if `chainId` is missing
|
|
141
|
+
- **BREAKING**: Change `TransactionMeta.chainId` to be required ([#1633](https://github.com/MetaMask/core/pull/1633))
|
|
142
|
+
- **BREAKING**: Bump peer dependency on `@metamask/network-controller` to ^13.0.0 ([#1633](https://github.com/MetaMask/core/pull/1633))
|
|
143
|
+
- Update `TransactionMeta.networkID` as deprecated ([#1633](https://github.com/MetaMask/core/pull/1633))
|
|
144
|
+
- Change `TransactionMeta.networkID` to be readonly ([#1633](https://github.com/MetaMask/core/pull/1633))
|
|
145
|
+
- Bump dependency on `@metamask/controller-utils` to ^5.0.0 ([#1633](https://github.com/MetaMask/core/pull/1633))
|
|
146
|
+
|
|
147
|
+
### Removed
|
|
148
|
+
- Remove `networkId` param from `RemoteTransactionSource.isSupportedNetwork()` interface ([#1633](https://github.com/MetaMask/core/pull/1633))
|
|
149
|
+
- Remove `currentNetworkId` property from `RemoteTransactionSourceRequest` ([#1633](https://github.com/MetaMask/core/pull/1633))
|
|
150
|
+
|
|
151
|
+
## [11.1.0]
|
|
152
|
+
### Added
|
|
153
|
+
- Add `type` property to the transaction metadata ([#1670](https://github.com/MetaMask/core/pull/1670))
|
|
154
|
+
|
|
155
|
+
## [11.0.0]
|
|
156
|
+
### Added
|
|
157
|
+
- Add optional `getLastBlockVariations` method to `RemoteTransactionSource` type ([#1668](https://github.com/MetaMask/core/pull/1668))
|
|
158
|
+
- Add `updateTransactionGasFees` method to `TransactionController` ([#1674](https://github.com/MetaMask/core/pull/1674))
|
|
159
|
+
- Add `r`, `s` and `v` properties to the transaction metadata ([#1664](https://github.com/MetaMask/core/pull/1664))
|
|
160
|
+
- Add `sendFlowHistory` property to the transaction metadata ([#1665](https://github.com/MetaMask/core/pull/1665))
|
|
161
|
+
- Add `updateTransactionSendFlowHistory` method to `TransactionController` ([#1665](https://github.com/MetaMask/core/pull/1665))
|
|
162
|
+
- Add `originalGasEstimate` property to the transaction metadata ([#1656](https://github.com/MetaMask/core/pull/1656))
|
|
163
|
+
- Add `incomingTransactions.queryEntireHistory` constructor option ([#1652](https://github.com/MetaMask/core/pull/1652))
|
|
164
|
+
|
|
165
|
+
### Changed
|
|
166
|
+
- **BREAKING**: Remove `apiKey` property from `RemoteTransactionSourceRequest` type ([#1668](https://github.com/MetaMask/core/pull/1668))
|
|
167
|
+
- **BREAKING**: Remove unused `FetchAllOptions` type from `TransactionController` ([#1668](https://github.com/MetaMask/core/pull/1668))
|
|
168
|
+
- **BREAKING**: Remove `incomingTransactions.apiKey` constructor option ([#1668](https://github.com/MetaMask/core/pull/1668))
|
|
169
|
+
- **BREAKING**: Rename the `transaction` object to `txParams` in the transaction metadata ([#1651](https://github.com/MetaMask/core/pull/1651))
|
|
170
|
+
- **BREAKING**: Add `disableHistory` constructor option ([#1657](https://github.com/MetaMask/core/pull/1657))
|
|
171
|
+
- Defaults to `false` but will increase state size considerably unless disabled
|
|
172
|
+
- **BREAKING**: Add `disableSendFlowHistory` constructor option ([#1665](https://github.com/MetaMask/core/pull/1665))
|
|
173
|
+
- Defaults to `false` but will increase state size considerably unless disabled
|
|
174
|
+
- **BREAKING**: Rename the `transactionHash` property to `hash` in the transaction metadata
|
|
175
|
+
|
|
176
|
+
### Fixed
|
|
177
|
+
- Fix the sorting of incoming and updated transactions ([#1652](https://github.com/MetaMask/core/pull/1652))
|
|
178
|
+
- Prevent rate limit errors when `incomingTransactions.includeTokenTransfers` is `true` by by alternating Etherscan request types on each update ([#1668](https://github.com/MetaMask/core/pull/1668))
|
|
179
|
+
|
|
180
|
+
## [10.0.0]
|
|
181
|
+
### Added
|
|
182
|
+
- Add `submittedTime` to the transaction metadata ([#1645](https://github.com/MetaMask/core/pull/1645))
|
|
183
|
+
- Add optional `actionId` argument to `addTransaction` and `speedUpTransaction` to prevent duplicate requests ([#1582](https://github.com/MetaMask/core/pull/1582))
|
|
184
|
+
- Add `confirmExternalTransaction` method ([#1625](https://github.com/MetaMask/core/pull/1625))
|
|
185
|
+
|
|
186
|
+
### Changed
|
|
187
|
+
- **BREAKING**: Rename `rawTransaction` to `rawTx` in the transaction metadata ([#1624](https://github.com/MetaMask/core/pull/1624))
|
|
188
|
+
|
|
189
|
+
## [9.2.0]
|
|
190
|
+
### Added
|
|
191
|
+
- Persist `estimatedBaseFee` in `stopTransaction` and `speedUpTransaction` ([#1621](https://github.com/MetaMask/core/pull/1621))
|
|
192
|
+
- Add `securityAlertResponse` to `addTransaction` `opts` argument ([#1636](https://github.com/MetaMask/core/pull/1636))
|
|
193
|
+
|
|
194
|
+
## [9.1.0]
|
|
195
|
+
### Added
|
|
196
|
+
- Add `blockTimestamp` to `TransactionMetaBase` type ([#1616](https://github.com/MetaMask/core/pull/1616))
|
|
197
|
+
- Update `queryTransactionStatuses` to populate `blockTimestamp` on each transaction when it is verified ([#1616](https://github.com/MetaMask/core/pull/1616))
|
|
198
|
+
|
|
199
|
+
### Changed
|
|
200
|
+
- Bump dependency and peer dependency on `@metamask/approval-controller` to ^3.5.1
|
|
201
|
+
- Bump dependency on `@metamask/base-controller` to ^3.2.1
|
|
202
|
+
- Bump dependency on `@metamask/controller-utils` to ^4.3.2
|
|
203
|
+
- Bump dependency and peer dependency on `@metamask/network-controller` to ^12.1.2
|
|
204
|
+
|
|
205
|
+
## [9.0.0]
|
|
206
|
+
### Added
|
|
207
|
+
- Add `baseFeePerGas` to transaction metadata ([#1590](https://github.com/MetaMask/core/pull/1590))
|
|
208
|
+
- Add `txReceipt` to transaction metadata ([#1592](https://github.com/MetaMask/core/pull/1592))
|
|
209
|
+
- Add `initApprovals` method to generate approval requests from unapproved transactions ([#1575](https://github.com/MetaMask/core/pull/1575))
|
|
210
|
+
- Add `dappSuggestedGasFees` to transaction metadata ([#1617](https://github.com/MetaMask/core/pull/1617))
|
|
211
|
+
- Add optional `incomingTransactions` constructor arguments ([#1579](https://github.com/MetaMask/core/pull/1579))
|
|
212
|
+
- `apiKey`
|
|
213
|
+
- `includeTokenTransfers`
|
|
214
|
+
- `isEnabled`
|
|
215
|
+
- `updateTransactions`
|
|
216
|
+
- Add incoming transaction methods ([#1579](https://github.com/MetaMask/core/pull/1579))
|
|
217
|
+
- `startIncomingTransactionPolling`
|
|
218
|
+
- `stopIncomingTransactionPolling`
|
|
219
|
+
- `updateIncomingTransactions`
|
|
220
|
+
- Add `requireApproval` option to `addTransaction` method options ([#1580](https://github.com/MetaMask/core/pull/1580))
|
|
221
|
+
- Add `address` argument to `wipeTransactions` method ([#1573](https://github.com/MetaMask/core/pull/1573))
|
|
222
|
+
|
|
223
|
+
### Changed
|
|
224
|
+
- **BREAKING**: Add required `getSelectedAddress` callback argument to constructor ([#1579](https://github.com/MetaMask/core/pull/1579))
|
|
225
|
+
- **BREAKING**: Add `isSupportedNetwork` method to `RemoteTransactionSource` interface ([#1579](https://github.com/MetaMask/core/pull/1579))
|
|
226
|
+
- **BREAKING**: Move all but first argument to options bag in `addTransaction` method ([#1576](https://github.com/MetaMask/core/pull/1576))
|
|
227
|
+
- **BREAKING**: Update properties of `RemoteTransactionSourceRequest` type ([#1579](https://github.com/MetaMask/core/pull/1579))
|
|
228
|
+
- The `fromBlock` property has changed from `string` to `number`
|
|
229
|
+
- The `networkType` property has been removed
|
|
230
|
+
- This type is intended mainly for internal use, so it's likely this change doesn't affect most projects
|
|
231
|
+
|
|
232
|
+
### Removed
|
|
233
|
+
- **BREAKING**: Remove `fetchAll` method ([#1579](https://github.com/MetaMask/core/pull/1579))
|
|
234
|
+
- This method was used to fetch transaction history from Etherscan
|
|
235
|
+
- This is now handled automatically by the controller on each new block, if polling is enabled
|
|
236
|
+
- Polling can be enabled or disabled by calling `startIncomingTransactionPolling` or `stopIncomingTransactionPolling` respectively
|
|
237
|
+
- An immediate update can be requested by calling `updateIncomingTransactions`
|
|
238
|
+
- The new constructor parameter `incomingTransactions.isEnabled` acts as an override to disable this functionality based on a client preference for example
|
|
239
|
+
- **BREAKING**: Remove `prepareUnsignedEthTx` and `getCommonConfiguration` methods ([#1581](https://github.com/MetaMask/core/pull/1581))
|
|
240
|
+
- These methods were intended mainly for internal use, so it's likely this change doesn't affect most projects
|
|
241
|
+
|
|
242
|
+
## [8.0.1]
|
|
243
|
+
### Changed
|
|
244
|
+
- Replace `eth-query` ^2.1.2 with `@metamask/eth-query` ^3.0.1 ([#1546](https://github.com/MetaMask/core/pull/1546))
|
|
245
|
+
|
|
246
|
+
## [8.0.0]
|
|
247
|
+
### Changed
|
|
248
|
+
- **BREAKING**: Change `babel-runtime` from a `dependency` to a `peerDependency` ([#1504](https://github.com/MetaMask/core/pull/1504))
|
|
249
|
+
- Update `@metamask/utils` to `^6.2.0` ([#1514](https://github.com/MetaMask/core/pull/1514))
|
|
250
|
+
|
|
251
|
+
## [7.1.0]
|
|
252
|
+
### Added
|
|
253
|
+
- Expose `HARDFORK` constant ([#1423](https://github.com/MetaMask/core/pull/1423))
|
|
254
|
+
- Add support for transactions on Linea networks ([#1423](https://github.com/MetaMask/core/pull/1423))
|
|
255
|
+
|
|
256
|
+
## [7.0.0]
|
|
257
|
+
### Changed
|
|
258
|
+
- **BREAKING**: Change the approveTransaction and cancelTransaction methods to private ([#1435](https://github.com/MetaMask/core/pull/1435))
|
|
259
|
+
- Consumers should migrate from use of these methods to use of `processApproval`.
|
|
260
|
+
- Update the TransactionController to await the approval request promise before automatically performing the relevant logic, either signing and submitting the transaction, or cancelling it ([#1435](https://github.com/MetaMask/core/pull/1435))
|
|
261
|
+
|
|
262
|
+
## [6.1.0]
|
|
263
|
+
### Changed
|
|
264
|
+
- Relax types of `provider` and `blockTracker` options ([#1443](https://github.com/MetaMask/core/pull/1443))
|
|
265
|
+
- The types used to require proxy versions of Provider and BlockTracker. Now they just require the non-proxy versions, which are a strict subset of the proxied versions.
|
|
266
|
+
|
|
267
|
+
## [6.0.0]
|
|
268
|
+
### Added
|
|
269
|
+
- Update transaction controller to automatically initiate, finalize, and cancel approval requests as transactions move through states ([#1241](https://github.com/MetaMask/core/pull/1241))
|
|
270
|
+
- The `ApprovalController:addRequest` action will be called when a new transaction is initiated
|
|
271
|
+
- The `ApprovalController:rejectRequest` action will be called if a transaction fails
|
|
272
|
+
- The `ApprovalController:acceptRequest` action will be called when a transaction is approved
|
|
273
|
+
|
|
274
|
+
### Changed
|
|
275
|
+
- **BREAKING:** Bump to Node 16 ([#1262](https://github.com/MetaMask/core/pull/1262))
|
|
276
|
+
- **BREAKING:** Update `@metamask/network-controller` dependency and peer dependency ([#1367](https://github.com/MetaMask/core/pull/1367))
|
|
277
|
+
- This affects the `getNetworkState` and `onNetworkStateChange` constructor parameters
|
|
278
|
+
- **BREAKING:** Change format of chain ID in state to `Hex` ([#1367](https://github.com/MetaMask/core/pull/1367))
|
|
279
|
+
- The `chainId` property of the `Transaction` type has been changed from `number` to `Hex`
|
|
280
|
+
- The `chainId` property of the `TransactionMeta` type has been changed from a decimal `string` to `Hex`, and the `transaction` property has been updated along with the `Transaction` type (as described above).
|
|
281
|
+
- The state property `transactions` is an array of `TransactionMeta` objects, so it has changed according to the description above.
|
|
282
|
+
- This requires a state migration: each entry should have the `chainId` property converted from a decimal `string` to `Hex`, and the `transaction.chainId` property changed from `number` to `Hex`.
|
|
283
|
+
- The `addTransaction` and `estimateGas` methods now expect the first parameter (`transaction`) to use type `Hex` for the `chainId` property.
|
|
284
|
+
- The `updateTransaction` method now expects the `transactionMeta` parameter to use type `Hex` for the `chainId` property (and for the nested `transaction.chainId` property)
|
|
285
|
+
- **BREAKING:** Add `messenger` as required constructor parameter ([#1241](https://github.com/MetaMask/core/pull/1241))
|
|
286
|
+
- **BREAKING:** Add `@metamask/approval-controller` as a dependency and peer dependency ([#1241](https://github.com/MetaMask/core/pull/1241), [#1393](https://github.com/MetaMask/core/pull/1393))
|
|
287
|
+
- Add `@metamask/utils` dependency ([#1367](https://github.com/MetaMask/core/pull/1367))
|
|
288
|
+
|
|
289
|
+
### Fixed
|
|
290
|
+
- Fix inaccurate hard-coded `chainId` on incoming token transactions ([#1366](https://github.com/MetaMask/core/pull/1366))
|
|
291
|
+
|
|
292
|
+
## [5.0.0]
|
|
293
|
+
### Changed
|
|
294
|
+
- **BREAKING**: peerDeps: @metamask/network-controller@6.0.0->8.0.0 ([#1196](https://github.com/MetaMask/core/pull/1196))
|
|
295
|
+
- deps: eth-rpc-errors@4.0.0->4.0.2 ([#1215](https://github.com/MetaMask/core/pull/1215))
|
|
296
|
+
- Add nonce tracker to transactions controller ([#1147](https://github.com/MetaMask/core/pull/1147))
|
|
297
|
+
- Previously this controller would get the next nonce by calling `eth_getTransactionCount` with a block reference of `pending`. The next nonce would then be returned from our middleware (within `web3-provider-engine`).
|
|
298
|
+
- Instead we're now using the nonce tracker to get the next nonce, dropping our reliance on this `eth_getTransactionCount` middleware. This will let us drop that middleware in a future update without impacting the transaction controller.
|
|
299
|
+
- This should result in no functional changes, except that the nonce middleware is no longer required.
|
|
300
|
+
|
|
301
|
+
## [4.0.1]
|
|
302
|
+
### Changed
|
|
303
|
+
- Use `NetworkType` enum for chain configuration ([#1132](https://github.com/MetaMask/core/pull/1132))
|
|
304
|
+
|
|
305
|
+
## [4.0.0]
|
|
306
|
+
### Removed
|
|
307
|
+
- **BREAKING:** Remove `isomorphic-fetch` ([#1106](https://github.com/MetaMask/controllers/pull/1106))
|
|
308
|
+
- Consumers must now import `isomorphic-fetch` or another polyfill themselves if they are running in an environment without `fetch`
|
|
309
|
+
|
|
310
|
+
## [3.0.0]
|
|
311
|
+
### Added
|
|
312
|
+
- Add Etherscan API support for Sepolia and Goerli ([#1041](https://github.com/MetaMask/controllers/pull/1041))
|
|
313
|
+
- Export `isEIP1559Transaction` function from package ([#1058](https://github.com/MetaMask/controllers/pull/1058))
|
|
314
|
+
|
|
315
|
+
### Changed
|
|
316
|
+
- **BREAKING**: Drop Etherscan API support for Ropsten, Rinkeby, and Kovan ([#1041](https://github.com/MetaMask/controllers/pull/1041))
|
|
317
|
+
- Rename this repository to `core` ([#1031](https://github.com/MetaMask/controllers/pull/1031))
|
|
318
|
+
- Update `@metamask/controller-utils` package ([#1041](https://github.com/MetaMask/controllers/pull/1041))
|
|
319
|
+
|
|
320
|
+
## [2.0.0]
|
|
321
|
+
### Changed
|
|
322
|
+
- **BREAKING:** Update `getNetworkState` constructor option to take an object with `providerConfig` property rather than `providerConfig` ([#995](https://github.com/MetaMask/core/pull/995))
|
|
323
|
+
- Relax dependency on `@metamask/base-controller`, `@metamask/controller-utils`, and `@metamask/network-controller` (use `^` instead of `~`) ([#998](https://github.com/MetaMask/core/pull/998))
|
|
324
|
+
|
|
325
|
+
## [1.0.0]
|
|
326
|
+
### Added
|
|
327
|
+
- Initial release
|
|
328
|
+
- As a result of converting our shared controllers repo into a monorepo ([#831](https://github.com/MetaMask/core/pull/831)), we've created this package from select parts of [`@metamask/controllers` v33.0.0](https://github.com/MetaMask/core/tree/v33.0.0), namely:
|
|
329
|
+
- Everything in `src/transaction`
|
|
330
|
+
- Transaction-related functions from `src/util.ts` and accompanying tests
|
|
331
|
+
|
|
332
|
+
All changes listed after this point were applied to this package following the monorepo conversion.
|
|
333
|
+
|
|
334
|
+
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@18.3.0...HEAD
|
|
335
|
+
[18.3.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@18.2.0...@metamask/transaction-controller@18.3.0
|
|
336
|
+
[18.2.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@18.1.0...@metamask/transaction-controller@18.2.0
|
|
337
|
+
[18.1.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@18.0.0...@metamask/transaction-controller@18.1.0
|
|
338
|
+
[18.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@17.0.0...@metamask/transaction-controller@18.0.0
|
|
339
|
+
[17.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@16.0.0...@metamask/transaction-controller@17.0.0
|
|
340
|
+
[16.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@15.0.0...@metamask/transaction-controller@16.0.0
|
|
341
|
+
[15.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@14.0.0...@metamask/transaction-controller@15.0.0
|
|
342
|
+
[14.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@13.0.0...@metamask/transaction-controller@14.0.0
|
|
343
|
+
[13.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@12.0.0...@metamask/transaction-controller@13.0.0
|
|
344
|
+
[12.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@11.1.0...@metamask/transaction-controller@12.0.0
|
|
345
|
+
[11.1.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@11.0.0...@metamask/transaction-controller@11.1.0
|
|
346
|
+
[11.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@10.0.0...@metamask/transaction-controller@11.0.0
|
|
347
|
+
[10.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@9.2.0...@metamask/transaction-controller@10.0.0
|
|
348
|
+
[9.2.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@9.1.0...@metamask/transaction-controller@9.2.0
|
|
349
|
+
[9.1.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@9.0.0...@metamask/transaction-controller@9.1.0
|
|
350
|
+
[9.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@8.0.1...@metamask/transaction-controller@9.0.0
|
|
351
|
+
[8.0.1]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@8.0.0...@metamask/transaction-controller@8.0.1
|
|
352
|
+
[8.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@7.1.0...@metamask/transaction-controller@8.0.0
|
|
353
|
+
[7.1.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@7.0.0...@metamask/transaction-controller@7.1.0
|
|
354
|
+
[7.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@6.1.0...@metamask/transaction-controller@7.0.0
|
|
355
|
+
[6.1.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@6.0.0...@metamask/transaction-controller@6.1.0
|
|
356
|
+
[6.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@5.0.0...@metamask/transaction-controller@6.0.0
|
|
357
|
+
[5.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@4.0.1...@metamask/transaction-controller@5.0.0
|
|
358
|
+
[4.0.1]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@4.0.0...@metamask/transaction-controller@4.0.1
|
|
359
|
+
[4.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@3.0.0...@metamask/transaction-controller@4.0.0
|
|
360
|
+
[3.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@2.0.0...@metamask/transaction-controller@3.0.0
|
|
361
|
+
[2.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@1.0.0...@metamask/transaction-controller@2.0.0
|
|
362
|
+
[1.0.0]: https://github.com/MetaMask/core/releases/tag/@metamask/transaction-controller@1.0.0
|
|
@@ -8,7 +8,7 @@ import type { GasFeeState } from '@metamask/gas-fee-controller';
|
|
|
8
8
|
import type { BlockTracker, NetworkState, Provider } from '@metamask/network-controller';
|
|
9
9
|
import type { Hex } from '@metamask/utils';
|
|
10
10
|
import { EventEmitter } from 'events';
|
|
11
|
-
import type { NonceLock } from 'nonce-tracker';
|
|
11
|
+
import type { NonceLock, Transaction as NonceTrackerTransaction } from 'nonce-tracker';
|
|
12
12
|
import type { Events, SavedGasFees, SecurityProviderRequest, SendFlowHistoryEntry, TransactionParams, TransactionMeta, TransactionReceipt, WalletDevice, SecurityAlertResponse } from './types';
|
|
13
13
|
import { TransactionType, TransactionStatus } from './types';
|
|
14
14
|
export declare const HARDFORK = Hardfork.London;
|
|
@@ -110,6 +110,7 @@ export declare class TransactionController extends BaseControllerV1<TransactionC
|
|
|
110
110
|
private readonly getGasFeeEstimates;
|
|
111
111
|
private readonly getPermittedAccounts;
|
|
112
112
|
private readonly getSelectedAddress;
|
|
113
|
+
private readonly getExternalPendingTransactions;
|
|
113
114
|
private readonly messagingSystem;
|
|
114
115
|
private readonly incomingTransactionHelper;
|
|
115
116
|
private readonly securityProviderRequest?;
|
|
@@ -144,12 +145,13 @@ export declare class TransactionController extends BaseControllerV1<TransactionC
|
|
|
144
145
|
* @param options.disableHistory - Whether to disable storing history in transaction metadata.
|
|
145
146
|
* @param options.disableSendFlowHistory - Explicitly disable transaction metadata history.
|
|
146
147
|
* @param options.disableSwaps - Whether to disable additional processing on swaps transactions.
|
|
147
|
-
* @param options.getSavedGasFees - Gets the saved gas fee config.
|
|
148
148
|
* @param options.getCurrentAccountEIP1559Compatibility - Whether or not the account supports EIP-1559.
|
|
149
149
|
* @param options.getCurrentNetworkEIP1559Compatibility - Whether or not the network supports EIP-1559.
|
|
150
|
+
* @param options.getExternalPendingTransactions - Callback to retrieve pending transactions from external sources.
|
|
150
151
|
* @param options.getGasFeeEstimates - Callback to retrieve gas fee estimates.
|
|
151
152
|
* @param options.getNetworkState - Gets the state of the network controller.
|
|
152
153
|
* @param options.getPermittedAccounts - Get accounts that a given origin has permissions for.
|
|
154
|
+
* @param options.getSavedGasFees - Gets the saved gas fee config.
|
|
153
155
|
* @param options.getSelectedAddress - Gets the address of the currently selected account.
|
|
154
156
|
* @param options.incomingTransactions - Configuration options for incoming transaction support.
|
|
155
157
|
* @param options.incomingTransactions.includeTokenTransfers - Whether or not to include ERC20 token transfers.
|
|
@@ -172,18 +174,19 @@ export declare class TransactionController extends BaseControllerV1<TransactionC
|
|
|
172
174
|
* @param config - Initial options used to configure this controller.
|
|
173
175
|
* @param state - Initial state to set on this controller.
|
|
174
176
|
*/
|
|
175
|
-
constructor({ blockTracker, cancelMultiplier, disableHistory, disableSendFlowHistory, disableSwaps,
|
|
177
|
+
constructor({ blockTracker, cancelMultiplier, disableHistory, disableSendFlowHistory, disableSwaps, getCurrentAccountEIP1559Compatibility, getCurrentNetworkEIP1559Compatibility, getExternalPendingTransactions, getGasFeeEstimates, getNetworkState, getPermittedAccounts, getSavedGasFees, getSelectedAddress, incomingTransactions, messenger, onNetworkStateChange, pendingTransactions, provider, securityProviderRequest, speedUpMultiplier, hooks, }: {
|
|
176
178
|
blockTracker: BlockTracker;
|
|
177
179
|
cancelMultiplier?: number;
|
|
178
180
|
disableHistory: boolean;
|
|
179
181
|
disableSendFlowHistory: boolean;
|
|
180
182
|
disableSwaps: boolean;
|
|
181
|
-
getSavedGasFees?: (chainId: Hex) => SavedGasFees | undefined;
|
|
182
183
|
getCurrentAccountEIP1559Compatibility?: () => Promise<boolean>;
|
|
183
184
|
getCurrentNetworkEIP1559Compatibility: () => Promise<boolean>;
|
|
185
|
+
getExternalPendingTransactions?: (address: string) => NonceTrackerTransaction[];
|
|
184
186
|
getGasFeeEstimates?: () => Promise<GasFeeState>;
|
|
185
187
|
getNetworkState: () => NetworkState;
|
|
186
188
|
getPermittedAccounts: (origin?: string) => Promise<string[]>;
|
|
189
|
+
getSavedGasFees?: (chainId: Hex) => SavedGasFees | undefined;
|
|
187
190
|
getSelectedAddress: () => string;
|
|
188
191
|
incomingTransactions?: {
|
|
189
192
|
includeTokenTransfers?: boolean;
|
|
@@ -593,6 +596,7 @@ export declare class TransactionController extends BaseControllerV1<TransactionC
|
|
|
593
596
|
private addPendingTransactionTrackerListeners;
|
|
594
597
|
private signTransaction;
|
|
595
598
|
private onTransactionStatusChange;
|
|
599
|
+
private getNonceTrackerPendingTransactions;
|
|
596
600
|
private getNonceTrackerTransactions;
|
|
597
601
|
private onConfirmedTransaction;
|
|
598
602
|
private updatePostBalance;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionController.d.ts","sourceRoot":"","sources":["../src/TransactionController.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAA4B,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,KAAK,EAEV,kBAAkB,EAEnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,6BAA6B,EAC9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAU7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAI3C,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGtC,OAAO,KAAK,
|
|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;;OAKG;IACH,OAAO,CAAC,0BAA0B;YAMpB,0BAA0B;IAUxC;;;;;;OAMG;YACW,wBAAwB;YAiBxB,uBAAuB;IAYrC,OAAO,CAAC,qCAAqC;YAsB/B,eAAe;IAuD7B,OAAO,CAAC,yBAAyB;IAIjC,OAAO,CAAC,kCAAkC;IAY1C,OAAO,CAAC,2BAA2B;IAcnC,OAAO,CAAC,sBAAsB;YAehB,iBAAiB;CAsBhC"}
|
|
@@ -66,12 +66,13 @@ class TransactionController extends base_controller_1.BaseControllerV1 {
|
|
|
66
66
|
* @param options.disableHistory - Whether to disable storing history in transaction metadata.
|
|
67
67
|
* @param options.disableSendFlowHistory - Explicitly disable transaction metadata history.
|
|
68
68
|
* @param options.disableSwaps - Whether to disable additional processing on swaps transactions.
|
|
69
|
-
* @param options.getSavedGasFees - Gets the saved gas fee config.
|
|
70
69
|
* @param options.getCurrentAccountEIP1559Compatibility - Whether or not the account supports EIP-1559.
|
|
71
70
|
* @param options.getCurrentNetworkEIP1559Compatibility - Whether or not the network supports EIP-1559.
|
|
71
|
+
* @param options.getExternalPendingTransactions - Callback to retrieve pending transactions from external sources.
|
|
72
72
|
* @param options.getGasFeeEstimates - Callback to retrieve gas fee estimates.
|
|
73
73
|
* @param options.getNetworkState - Gets the state of the network controller.
|
|
74
74
|
* @param options.getPermittedAccounts - Get accounts that a given origin has permissions for.
|
|
75
|
+
* @param options.getSavedGasFees - Gets the saved gas fee config.
|
|
75
76
|
* @param options.getSelectedAddress - Gets the address of the currently selected account.
|
|
76
77
|
* @param options.incomingTransactions - Configuration options for incoming transaction support.
|
|
77
78
|
* @param options.incomingTransactions.includeTokenTransfers - Whether or not to include ERC20 token transfers.
|
|
@@ -94,7 +95,7 @@ class TransactionController extends base_controller_1.BaseControllerV1 {
|
|
|
94
95
|
* @param config - Initial options used to configure this controller.
|
|
95
96
|
* @param state - Initial state to set on this controller.
|
|
96
97
|
*/
|
|
97
|
-
constructor({ blockTracker, cancelMultiplier, disableHistory, disableSendFlowHistory, disableSwaps,
|
|
98
|
+
constructor({ blockTracker, cancelMultiplier, disableHistory, disableSendFlowHistory, disableSwaps, getCurrentAccountEIP1559Compatibility, getCurrentNetworkEIP1559Compatibility, getExternalPendingTransactions, getGasFeeEstimates, getNetworkState, getPermittedAccounts, getSavedGasFees, getSelectedAddress, incomingTransactions = {}, messenger, onNetworkStateChange, pendingTransactions = {}, provider, securityProviderRequest, speedUpMultiplier, hooks = {}, }, config, state) {
|
|
98
99
|
var _a, _b, _c, _d, _e;
|
|
99
100
|
super(config, state);
|
|
100
101
|
this.inProcessOfSigning = new Set();
|
|
@@ -133,6 +134,8 @@ class TransactionController extends base_controller_1.BaseControllerV1 {
|
|
|
133
134
|
getGasFeeEstimates || (() => Promise.resolve({}));
|
|
134
135
|
this.getPermittedAccounts = getPermittedAccounts;
|
|
135
136
|
this.getSelectedAddress = getSelectedAddress;
|
|
137
|
+
this.getExternalPendingTransactions =
|
|
138
|
+
getExternalPendingTransactions !== null && getExternalPendingTransactions !== void 0 ? getExternalPendingTransactions : (() => []);
|
|
136
139
|
this.securityProviderRequest = securityProviderRequest;
|
|
137
140
|
this.cancelMultiplier = cancelMultiplier !== null && cancelMultiplier !== void 0 ? cancelMultiplier : exports.CANCEL_RATE;
|
|
138
141
|
this.speedUpMultiplier = speedUpMultiplier !== null && speedUpMultiplier !== void 0 ? speedUpMultiplier : exports.SPEED_UP_RATE;
|
|
@@ -149,7 +152,7 @@ class TransactionController extends base_controller_1.BaseControllerV1 {
|
|
|
149
152
|
// @ts-expect-error provider types misaligned: SafeEventEmitterProvider vs Record<string,string>
|
|
150
153
|
provider,
|
|
151
154
|
blockTracker,
|
|
152
|
-
getPendingTransactions: this.
|
|
155
|
+
getPendingTransactions: this.getNonceTrackerPendingTransactions.bind(this),
|
|
153
156
|
getConfirmedTransactions: this.getNonceTrackerTransactions.bind(this, types_1.TransactionStatus.confirmed),
|
|
154
157
|
});
|
|
155
158
|
this.incomingTransactionHelper = new IncomingTransactionHelper_1.IncomingTransactionHelper({
|
|
@@ -810,6 +813,9 @@ class TransactionController extends base_controller_1.BaseControllerV1 {
|
|
|
810
813
|
*/
|
|
811
814
|
approveTransactionsWithSameNonce(listOfTxParams = []) {
|
|
812
815
|
return __awaiter(this, void 0, void 0, function* () {
|
|
816
|
+
(0, logger_1.projectLogger)('Approving transactions with same nonce', {
|
|
817
|
+
transactions: listOfTxParams,
|
|
818
|
+
});
|
|
813
819
|
if (listOfTxParams.length === 0) {
|
|
814
820
|
return '';
|
|
815
821
|
}
|
|
@@ -829,6 +835,7 @@ class TransactionController extends base_controller_1.BaseControllerV1 {
|
|
|
829
835
|
const fromAddress = initialTx.from;
|
|
830
836
|
nonceLock = yield this.nonceTracker.getNonceLock(fromAddress);
|
|
831
837
|
const nonce = nonceLock.nextNonce;
|
|
838
|
+
(0, logger_1.projectLogger)('Using nonce from nonce tracker', nonce, nonceLock.nonceDetails);
|
|
832
839
|
rawTransactions = yield Promise.all(listOfTxParams.map((txParams) => {
|
|
833
840
|
txParams.nonce = (0, ethereumjs_util_1.addHexPrefix)(nonce.toString(16));
|
|
834
841
|
return this.signExternalTransaction(txParams);
|
|
@@ -1564,6 +1571,11 @@ class TransactionController extends base_controller_1.BaseControllerV1 {
|
|
|
1564
1571
|
onTransactionStatusChange(transactionMeta) {
|
|
1565
1572
|
this.hub.emit('transaction-status-update', { transactionMeta });
|
|
1566
1573
|
}
|
|
1574
|
+
getNonceTrackerPendingTransactions(address) {
|
|
1575
|
+
const standardPendingTransactions = this.getNonceTrackerTransactions(types_1.TransactionStatus.submitted, address);
|
|
1576
|
+
const externalPendingTransactions = this.getExternalPendingTransactions(address);
|
|
1577
|
+
return [...standardPendingTransactions, ...externalPendingTransactions];
|
|
1578
|
+
}
|
|
1567
1579
|
getNonceTrackerTransactions(status, address) {
|
|
1568
1580
|
const currentChainId = this.getChainId();
|
|
1569
1581
|
return (0, nonce_1.getAndFormatTransactionsForNonceTracker)(currentChainId, address, status, this.state.transactions);
|