@metamask/transaction-controller 13.0.0 → 15.0.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 CHANGED
@@ -6,6 +6,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [15.0.0]
10
+ ### Changed
11
+ - **BREAKING:** Bump dependency and peer dependency on `@metamask/network-controller` to ^15.0.0
12
+ - Bump dependency on `@metamask/rpc-errors` to ^6.1.0 ([#1653](https://github.com/MetaMask/core/pull/1653))
13
+ - Bump dependency and peer dependency on `@metamask/approval-controller` to ^4.0.1
14
+
15
+ ## [14.0.0]
16
+ ### Added
17
+ - **BREAKING:** Add required `getPermittedAccounts` argument to constructor, used to validate `from` addresses ([#1722](https://github.com/MetaMask/core/pull/1722))
18
+ - Add `securityProviderRequest` option to constructor ([#1725](https://github.com/MetaMask/core/pull/1725))
19
+ - Add `method` option to `addTransaction` method ([#1725](https://github.com/MetaMask/core/pull/1725))
20
+ - Add `securityProviderRequest` property to TransactionMetaBase ([#1725](https://github.com/MetaMask/core/pull/1725))
21
+ - Add SecurityProviderRequest type ([#1725](https://github.com/MetaMask/core/pull/1725))
22
+ - Update `addTransaction` to set `securityProviderRequest` on transaction metadata when requested to do so ([#1725](https://github.com/MetaMask/core/pull/1725))
23
+ - Update `txParams` validation to validate `chainId` ([#1723](https://github.com/MetaMask/core/pull/1723))
24
+ - Update `addTransaction` to ensure allowed `from` address when `origin` is specified ([#1722](https://github.com/MetaMask/core/pull/1722))
25
+
26
+ ### Changed
27
+ - Bump dependency on `@metamask/utils` to ^8.1.0 ([#1639](https://github.com/MetaMask/core/pull/1639))
28
+ - Bump dependency and peer dependency on `@metamask/approval-controller` to ^4.0.0
29
+ - Bump dependency on `@metamask/base-controller` to ^3.2.3
30
+ - Bump dependency on `@metamask/controller-utils` to ^5.0.2
31
+ - Bump dependency and peer dependency on `@metamask/network-controller` to ^14.0.0
32
+
33
+ ### Removed
34
+ - **BREAKING:** Remove `interval` config option ([#1746](https://github.com/MetaMask/core/pull/1746))
35
+ - The block tracker (which has its own interval) is now used to poll for pending transactions instead.
36
+ - **BREAKING:** Remove `poll` method ([#1746](https://github.com/MetaMask/core/pull/1746))
37
+ - The block tracker is assumed to be running, TransactionController does not offer a way to stop it.
38
+ - **BREAKING:** Remove `queryTransactionStatuses` method ([#1746](https://github.com/MetaMask/core/pull/1746))
39
+ - This functionality has been moved to a private interface and there is no way to use it externally.
40
+
9
41
  ## [13.0.0]
10
42
  ### Changed
11
43
  - **BREAKING**: Add required `getCurrentAccountEIP1559Compatibility` and `getCurrentNetworkEIP1559Compatibility` callback arguments to constructor ([#1693](https://github.com/MetaMask/core/pull/1693))
@@ -211,7 +243,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
211
243
 
212
244
  All changes listed after this point were applied to this package following the monorepo conversion.
213
245
 
214
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@13.0.0...HEAD
246
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@15.0.0...HEAD
247
+ [15.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@14.0.0...@metamask/transaction-controller@15.0.0
248
+ [14.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@13.0.0...@metamask/transaction-controller@14.0.0
215
249
  [13.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@12.0.0...@metamask/transaction-controller@13.0.0
216
250
  [12.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@11.1.0...@metamask/transaction-controller@12.0.0
217
251
  [11.1.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@11.0.0...@metamask/transaction-controller@11.1.0
@@ -0,0 +1,18 @@
1
+ /// <reference types="node" />
2
+ import type EthQuery from '@metamask/eth-query';
3
+ import type { BlockTracker } from '@metamask/network-controller';
4
+ import EventEmitter from 'events';
5
+ import type { TransactionMeta } from './types';
6
+ export declare class PendingTransactionTracker {
7
+ #private;
8
+ hub: EventEmitter;
9
+ constructor({ blockTracker, failTransaction, getChainId, getEthQuery, getTransactions, }: {
10
+ blockTracker: BlockTracker;
11
+ failTransaction: (txMeta: TransactionMeta, error: Error) => void;
12
+ getChainId: () => string;
13
+ getEthQuery: () => EthQuery;
14
+ getTransactions: () => TransactionMeta[];
15
+ });
16
+ start(): void;
17
+ }
18
+ //# sourceMappingURL=PendingTransactionTracker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PendingTransactionTracker.d.ts","sourceRoot":"","sources":["../src/PendingTransactionTracker.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,YAAY,MAAM,QAAQ,CAAC;AAGlC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C,qBAAa,yBAAyB;;IACpC,GAAG,EAAE,YAAY,CAAC;gBAYN,EACV,YAAY,EACZ,eAAe,EACf,UAAU,EACV,WAAW,EACX,eAAe,GAChB,EAAE;QACD,YAAY,EAAE,YAAY,CAAC;QAC3B,eAAe,EAAE,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;QACjE,UAAU,EAAE,MAAM,MAAM,CAAC;QACzB,WAAW,EAAE,MAAM,QAAQ,CAAC;QAC5B,eAAe,EAAE,MAAM,eAAe,EAAE,CAAC;KAC1C;IAUD,KAAK;CA4JN"}
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
12
+ if (kind === "m") throw new TypeError("Private method is not writable");
13
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
14
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
15
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
16
+ };
17
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
18
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
19
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
20
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
21
+ };
22
+ var __importDefault = (this && this.__importDefault) || function (mod) {
23
+ return (mod && mod.__esModule) ? mod : { "default": mod };
24
+ };
25
+ var _PendingTransactionTracker_instances, _PendingTransactionTracker_blockTracker, _PendingTransactionTracker_failTransaction, _PendingTransactionTracker_getChainId, _PendingTransactionTracker_getEthQuery, _PendingTransactionTracker_getTransactions, _PendingTransactionTracker_onLatestBlock, _PendingTransactionTracker_blockchainTransactionStateReconciler, _PendingTransactionTracker_checkTxReceiptStatusIsFailed;
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.PendingTransactionTracker = void 0;
28
+ const controller_utils_1 = require("@metamask/controller-utils");
29
+ const events_1 = __importDefault(require("events"));
30
+ const logger_1 = require("./logger");
31
+ const types_1 = require("./types");
32
+ class PendingTransactionTracker {
33
+ constructor({ blockTracker, failTransaction, getChainId, getEthQuery, getTransactions, }) {
34
+ _PendingTransactionTracker_instances.add(this);
35
+ _PendingTransactionTracker_blockTracker.set(this, void 0);
36
+ _PendingTransactionTracker_failTransaction.set(this, void 0);
37
+ _PendingTransactionTracker_getChainId.set(this, void 0);
38
+ _PendingTransactionTracker_getEthQuery.set(this, void 0);
39
+ _PendingTransactionTracker_getTransactions.set(this, void 0);
40
+ this.hub = new events_1.default();
41
+ __classPrivateFieldSet(this, _PendingTransactionTracker_blockTracker, blockTracker, "f");
42
+ __classPrivateFieldSet(this, _PendingTransactionTracker_failTransaction, failTransaction, "f");
43
+ __classPrivateFieldSet(this, _PendingTransactionTracker_getChainId, getChainId, "f");
44
+ __classPrivateFieldSet(this, _PendingTransactionTracker_getEthQuery, getEthQuery, "f");
45
+ __classPrivateFieldSet(this, _PendingTransactionTracker_getTransactions, getTransactions, "f");
46
+ }
47
+ start() {
48
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
49
+ __classPrivateFieldGet(this, _PendingTransactionTracker_blockTracker, "f").addListener('latest', () => __awaiter(this, void 0, void 0, function* () {
50
+ yield (0, controller_utils_1.safelyExecute)(() => __classPrivateFieldGet(this, _PendingTransactionTracker_instances, "m", _PendingTransactionTracker_onLatestBlock).call(this));
51
+ }));
52
+ }
53
+ }
54
+ exports.PendingTransactionTracker = PendingTransactionTracker;
55
+ _PendingTransactionTracker_blockTracker = new WeakMap(), _PendingTransactionTracker_failTransaction = new WeakMap(), _PendingTransactionTracker_getChainId = new WeakMap(), _PendingTransactionTracker_getEthQuery = new WeakMap(), _PendingTransactionTracker_getTransactions = new WeakMap(), _PendingTransactionTracker_instances = new WeakSet(), _PendingTransactionTracker_onLatestBlock = function _PendingTransactionTracker_onLatestBlock() {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ (0, logger_1.pendingTransactionsLogger)('Checking transactions');
58
+ const transactions = __classPrivateFieldGet(this, _PendingTransactionTracker_getTransactions, "f").call(this);
59
+ const currentChainId = __classPrivateFieldGet(this, _PendingTransactionTracker_getChainId, "f").call(this);
60
+ let gotUpdates = false;
61
+ yield (0, controller_utils_1.safelyExecute)(() => Promise.all(transactions.map((meta, index) => __awaiter(this, void 0, void 0, function* () {
62
+ if (!meta.verifiedOnBlockchain && meta.chainId === currentChainId) {
63
+ const [reconciledTx, updateRequired] = yield __classPrivateFieldGet(this, _PendingTransactionTracker_instances, "m", _PendingTransactionTracker_blockchainTransactionStateReconciler).call(this, meta);
64
+ if (updateRequired) {
65
+ transactions[index] = reconciledTx;
66
+ gotUpdates = updateRequired;
67
+ }
68
+ }
69
+ }))));
70
+ /* istanbul ignore else */
71
+ if (gotUpdates) {
72
+ this.hub.emit('transactions', transactions);
73
+ }
74
+ });
75
+ }, _PendingTransactionTracker_blockchainTransactionStateReconciler = function _PendingTransactionTracker_blockchainTransactionStateReconciler(meta) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ const { status, hash, id, chainId, txParams: { to }, } = meta;
78
+ switch (status) {
79
+ case types_1.TransactionStatus.confirmed:
80
+ (0, logger_1.pendingTransactionsLogger)('Checking confirmed transaction', {
81
+ id,
82
+ chainId,
83
+ to,
84
+ });
85
+ const txReceipt = yield (0, controller_utils_1.query)(__classPrivateFieldGet(this, _PendingTransactionTracker_getEthQuery, "f").call(this), 'getTransactionReceipt', [hash]);
86
+ if (!txReceipt) {
87
+ return [meta, false];
88
+ }
89
+ const txBlock = yield (0, controller_utils_1.query)(__classPrivateFieldGet(this, _PendingTransactionTracker_getEthQuery, "f").call(this), 'getBlockByHash', [
90
+ txReceipt.blockHash,
91
+ ]);
92
+ meta.verifiedOnBlockchain = true;
93
+ meta.txParams.gasUsed = txReceipt.gasUsed;
94
+ meta.txReceipt = txReceipt;
95
+ meta.baseFeePerGas = txBlock === null || txBlock === void 0 ? void 0 : txBlock.baseFeePerGas;
96
+ meta.blockTimestamp = txBlock === null || txBlock === void 0 ? void 0 : txBlock.timestamp;
97
+ // According to the Web3 docs:
98
+ // TRUE if the transaction was successful, FALSE if the EVM reverted the transaction.
99
+ if (Number(txReceipt.status) === 0) {
100
+ const error = new Error('Transaction failed. The transaction was reversed');
101
+ __classPrivateFieldGet(this, _PendingTransactionTracker_failTransaction, "f").call(this, meta, error);
102
+ return [meta, false];
103
+ }
104
+ return [meta, true];
105
+ case types_1.TransactionStatus.submitted:
106
+ (0, logger_1.pendingTransactionsLogger)('Checking submitted transaction', {
107
+ id,
108
+ chainId,
109
+ to,
110
+ });
111
+ const txObj = yield (0, controller_utils_1.query)(__classPrivateFieldGet(this, _PendingTransactionTracker_getEthQuery, "f").call(this), 'getTransactionByHash', [
112
+ hash,
113
+ ]);
114
+ if (!txObj) {
115
+ const receiptShowsFailedStatus = yield __classPrivateFieldGet(this, _PendingTransactionTracker_instances, "m", _PendingTransactionTracker_checkTxReceiptStatusIsFailed).call(this, hash);
116
+ // Case the txObj is evaluated as false, a second check will
117
+ // determine if the tx failed or it is pending or confirmed
118
+ if (receiptShowsFailedStatus) {
119
+ const error = new Error('Transaction failed. The transaction was dropped or replaced by a new one');
120
+ __classPrivateFieldGet(this, _PendingTransactionTracker_failTransaction, "f").call(this, meta, error);
121
+ }
122
+ }
123
+ /* istanbul ignore next */
124
+ if (txObj === null || txObj === void 0 ? void 0 : txObj.blockNumber) {
125
+ meta.status = types_1.TransactionStatus.confirmed;
126
+ this.hub.emit('transaction-confirmed', meta);
127
+ return [meta, true];
128
+ }
129
+ return [meta, false];
130
+ default:
131
+ return [meta, false];
132
+ }
133
+ });
134
+ }, _PendingTransactionTracker_checkTxReceiptStatusIsFailed = function _PendingTransactionTracker_checkTxReceiptStatusIsFailed(txHash) {
135
+ return __awaiter(this, void 0, void 0, function* () {
136
+ const txReceipt = yield (0, controller_utils_1.query)(__classPrivateFieldGet(this, _PendingTransactionTracker_getEthQuery, "f").call(this), 'getTransactionReceipt', [txHash]);
137
+ if (!txReceipt) {
138
+ // Transaction is pending
139
+ return false;
140
+ }
141
+ return Number(txReceipt.status) === 0;
142
+ });
143
+ };
144
+ //# sourceMappingURL=PendingTransactionTrac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AE,KAAK,CAAC,CAAC;qBACpC;iBACF;gBAED,0BAA0B;gBAC1B,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,WAAW,EAAE;oBACtB,IAAI,CAAC,MAAM,GAAG,yBAAiB,CAAC,SAAS,CAAC;oBAC1C,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC;oBAC7C,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;iBACrB;gBAED,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YACvB;gBACE,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;SACxB;IACH,CAAC;8HAYC,MAA0B;;QAE1B,MAAM,SAAS,GAAG,MAAM,IAAA,wBAAK,EAC3B,uBAAA,IAAI,8CAAa,MAAjB,IAAI,CAAe,EACnB,uBAAuB,EACvB,CAAC,MAAM,CAAC,CACT,CAAC;QACF,IAAI,CAAC,SAAS,EAAE;YACd,yBAAyB;YACzB,OAAO,KAAK,CAAC;SACd;QACD,OAAO,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC","sourcesContent":["import { query, safelyExecute } from '@metamask/controller-utils';\nimport type EthQuery from '@metamask/eth-query';\nimport type { BlockTracker } from '@metamask/network-controller';\nimport EventEmitter from 'events';\n\nimport { pendingTransactionsLogger as log } from './logger';\nimport type { TransactionMeta } from './types';\nimport { TransactionStatus } from './types';\n\nexport class PendingTransactionTracker {\n hub: EventEmitter;\n\n #blockTracker: BlockTracker;\n\n #failTransaction: (txMeta: TransactionMeta, error: Error) => void;\n\n #getChainId: () => string;\n\n #getEthQuery: () => EthQuery;\n\n #getTransactions: () => TransactionMeta[];\n\n constructor({\n blockTracker,\n failTransaction,\n getChainId,\n getEthQuery,\n getTransactions,\n }: {\n blockTracker: BlockTracker;\n failTransaction: (txMeta: TransactionMeta, error: Error) => void;\n getChainId: () => string;\n getEthQuery: () => EthQuery;\n getTransactions: () => TransactionMeta[];\n }) {\n this.hub = new EventEmitter();\n\n this.#blockTracker = blockTracker;\n this.#failTransaction = failTransaction;\n this.#getChainId = getChainId;\n this.#getEthQuery = getEthQuery;\n this.#getTransactions = getTransactions;\n }\n\n start() {\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n this.#blockTracker.addListener('latest', async () => {\n await safelyExecute(() => this.#onLatestBlock());\n });\n }\n\n /**\n * Check the status of submitted transactions on the network to determine whether they have\n * been included in a block. Any that have been included in a block are marked as confirmed.\n */\n async #onLatestBlock() {\n log('Checking transactions');\n\n const transactions = this.#getTransactions();\n const currentChainId = this.#getChainId();\n let gotUpdates = false;\n\n await safelyExecute(() =>\n Promise.all(\n transactions.map(async (meta, index) => {\n if (!meta.verifiedOnBlockchain && meta.chainId === currentChainId) {\n const [reconciledTx, updateRequired] =\n await this.#blockchainTransactionStateReconciler(meta);\n if (updateRequired) {\n transactions[index] = reconciledTx;\n gotUpdates = updateRequired;\n }\n }\n }),\n ),\n );\n\n /* istanbul ignore else */\n if (gotUpdates) {\n this.hub.emit('transactions', transactions);\n }\n }\n\n /**\n * Method to verify the state of a transaction using the Blockchain as a source of truth.\n *\n * @param meta - The local transaction to verify on the blockchain.\n * @returns A tuple containing the updated transaction, and whether or not an update was required.\n */\n async #blockchainTransactionStateReconciler(\n meta: TransactionMeta,\n ): Promise<[TransactionMeta, boolean]> {\n const {\n status,\n hash,\n id,\n chainId,\n txParams: { to },\n } = meta;\n\n switch (status) {\n case TransactionStatus.confirmed:\n log('Checking confirmed transaction', {\n id,\n chainId,\n to,\n });\n\n const txReceipt = await query(\n this.#getEthQuery(),\n 'getTransactionReceipt',\n [hash],\n );\n\n if (!txReceipt) {\n return [meta, false];\n }\n\n const txBlock = await query(this.#getEthQuery(), 'getBlockByHash', [\n txReceipt.blockHash,\n ]);\n\n meta.verifiedOnBlockchain = true;\n meta.txParams.gasUsed = txReceipt.gasUsed;\n meta.txReceipt = txReceipt;\n meta.baseFeePerGas = txBlock?.baseFeePerGas;\n meta.blockTimestamp = txBlock?.timestamp;\n\n // According to the Web3 docs:\n // TRUE if the transaction was successful, FALSE if the EVM reverted the transaction.\n if (Number(txReceipt.status) === 0) {\n const error: Error = new Error(\n 'Transaction failed. The transaction was reversed',\n );\n this.#failTransaction(meta, error);\n return [meta, false];\n }\n\n return [meta, true];\n case TransactionStatus.submitted:\n log('Checking submitted transaction', {\n id,\n chainId,\n to,\n });\n\n const txObj = await query(this.#getEthQuery(), 'getTransactionByHash', [\n hash,\n ]);\n\n if (!txObj) {\n const receiptShowsFailedStatus =\n await this.#checkTxReceiptStatusIsFailed(hash);\n\n // Case the txObj is evaluated as false, a second check will\n // determine if the tx failed or it is pending or confirmed\n if (receiptShowsFailedStatus) {\n const error: Error = new Error(\n 'Transaction failed. The transaction was dropped or replaced by a new one',\n );\n this.#failTransaction(meta, error);\n }\n }\n\n /* istanbul ignore next */\n if (txObj?.blockNumber) {\n meta.status = TransactionStatus.confirmed;\n this.hub.emit('transaction-confirmed', meta);\n return [meta, true];\n }\n\n return [meta, false];\n default:\n return [meta, false];\n }\n }\n\n /**\n * Method to check if a tx has failed according to their receipt\n * According to the Web3 docs:\n * TRUE if the transaction was successful, FALSE if the EVM reverted the transaction.\n * The receipt is not available for pending transactions and returns null.\n *\n * @param txHash - The transaction hash.\n * @returns Whether the transaction has failed.\n */\n async #checkTxReceiptStatusIsFailed(\n txHash: string | undefined,\n ): Promise<boolean> {\n const txReceipt = await query(\n this.#getEthQuery(),\n 'getTransactionReceipt',\n [txHash],\n );\n if (!txReceipt) {\n // Transaction is pending\n return false;\n }\n return Number(txReceipt.status) === 0;\n }\n}\n"]}
@@ -7,7 +7,7 @@ import { BaseController } from '@metamask/base-controller';
7
7
  import type { BlockTracker, NetworkState, Provider } from '@metamask/network-controller';
8
8
  import type { Hex } from '@metamask/utils';
9
9
  import { EventEmitter } from 'events';
10
- import type { TransactionParams, TransactionMeta, TransactionReceipt, SendFlowHistoryEntry, WalletDevice } from './types';
10
+ import type { TransactionParams, TransactionMeta, TransactionReceipt, SecurityProviderRequest, SendFlowHistoryEntry, WalletDevice } from './types';
11
11
  import { TransactionType } from './types';
12
12
  export declare const HARDFORK = Hardfork.London;
13
13
  /**
@@ -30,12 +30,10 @@ export interface FeeMarketEIP1559Values {
30
30
  * @type TransactionConfig
31
31
  *
32
32
  * Transaction controller configuration
33
- * @property interval - Polling interval used to fetch new currency rate
34
33
  * @property provider - Provider used to create a new underlying EthQuery instance
35
34
  * @property sign - Method used to sign transactions
36
35
  */
37
36
  export interface TransactionConfig extends BaseConfig {
38
- interval: number;
39
37
  sign?: (txParams: TransactionParams, from: string) => Promise<any>;
40
38
  txHistoryLimit: number;
41
39
  }
@@ -96,13 +94,17 @@ export declare class TransactionController extends BaseController<TransactionCon
96
94
  private readonly nonceTracker;
97
95
  private registry;
98
96
  private readonly provider;
99
- private handle?;
97
+ private readonly handle?;
100
98
  private readonly mutex;
101
99
  private readonly getNetworkState;
102
100
  private readonly getCurrentAccountEIP1559Compatibility;
103
101
  private readonly getCurrentNetworkEIP1559Compatibility;
102
+ private readonly getPermittedAccounts;
103
+ private readonly getSelectedAddress;
104
104
  private readonly messagingSystem;
105
105
  private readonly incomingTransactionHelper;
106
+ private readonly securityProviderRequest?;
107
+ private readonly pendingTransactionTracker;
106
108
  private failTransaction;
107
109
  private registryLookup;
108
110
  /**
@@ -127,6 +129,7 @@ export declare class TransactionController extends BaseController<TransactionCon
127
129
  * @param options.getCurrentAccountEIP1559Compatibility - Whether or not the account supports EIP-1559.
128
130
  * @param options.getCurrentNetworkEIP1559Compatibility - Whether or not the network supports EIP-1559.
129
131
  * @param options.getNetworkState - Gets the state of the network controller.
132
+ * @param options.getPermittedAccounts - Get accounts that a given origin has permissions for.
130
133
  * @param options.getSelectedAddress - Gets the address of the currently selected account.
131
134
  * @param options.incomingTransactions - Configuration options for incoming transaction support.
132
135
  * @param options.incomingTransactions.includeTokenTransfers - Whether or not to include ERC20 token transfers.
@@ -136,16 +139,18 @@ export declare class TransactionController extends BaseController<TransactionCon
136
139
  * @param options.messenger - The controller messenger.
137
140
  * @param options.onNetworkStateChange - Allows subscribing to network controller state changes.
138
141
  * @param options.provider - The provider used to create the underlying EthQuery instance.
142
+ * @param options.securityProviderRequest - A function for verifying a transaction, whether it is malicious or not.
139
143
  * @param config - Initial options used to configure this controller.
140
144
  * @param state - Initial state to set on this controller.
141
145
  */
142
- constructor({ blockTracker, disableHistory, disableSendFlowHistory, getCurrentAccountEIP1559Compatibility, getCurrentNetworkEIP1559Compatibility, getNetworkState, getSelectedAddress, incomingTransactions, messenger, onNetworkStateChange, provider, }: {
146
+ constructor({ blockTracker, disableHistory, disableSendFlowHistory, getCurrentAccountEIP1559Compatibility, getCurrentNetworkEIP1559Compatibility, getNetworkState, getPermittedAccounts, getSelectedAddress, incomingTransactions, messenger, onNetworkStateChange, provider, securityProviderRequest, }: {
143
147
  blockTracker: BlockTracker;
144
148
  disableHistory: boolean;
145
149
  disableSendFlowHistory: boolean;
146
150
  getCurrentAccountEIP1559Compatibility: () => Promise<boolean>;
147
151
  getCurrentNetworkEIP1559Compatibility: () => Promise<boolean>;
148
152
  getNetworkState: () => NetworkState;
153
+ getPermittedAccounts: (origin?: string) => Promise<string[]>;
149
154
  getSelectedAddress: () => string;
150
155
  incomingTransactions: {
151
156
  includeTokenTransfers?: boolean;
@@ -156,13 +161,8 @@ export declare class TransactionController extends BaseController<TransactionCon
156
161
  messenger: TransactionControllerMessenger;
157
162
  onNetworkStateChange: (listener: (state: NetworkState) => void) => void;
158
163
  provider: Provider;
164
+ securityProviderRequest?: SecurityProviderRequest;
159
165
  }, config?: Partial<TransactionConfig>, state?: Partial<TransactionState>);
160
- /**
161
- * Starts a new polling interval.
162
- *
163
- * @param interval - The polling interval used to fetch new transaction statuses.
164
- */
165
- poll(interval?: number): Promise<void>;
166
166
  /**
167
167
  * Handle new method data request.
168
168
  *
@@ -179,6 +179,7 @@ export declare class TransactionController extends BaseController<TransactionCon
179
179
  * @param opts - Additional options to control how the transaction is added.
180
180
  * @param opts.actionId - Unique ID to prevent duplicate requests.
181
181
  * @param opts.deviceConfirmedOn - An enum to indicate what device confirmed the transaction.
182
+ * @param opts.method - RPC method that requested the transaction.
182
183
  * @param opts.origin - The origin of the transaction request, such as a dApp hostname.
183
184
  * @param opts.requireApproval - Whether the transaction requires approval by the user, defaults to true unless explicitly disabled.
184
185
  * @param opts.securityAlertResponse - Response from security validator.
@@ -186,9 +187,10 @@ export declare class TransactionController extends BaseController<TransactionCon
186
187
  * @param opts.type - Type of transaction to add, such as 'cancel' or 'swap'.
187
188
  * @returns Object containing a promise resolving to the transaction hash if approved.
188
189
  */
189
- addTransaction(txParams: TransactionParams, { actionId, deviceConfirmedOn, origin, requireApproval, securityAlertResponse, sendFlowHistory, type, }?: {
190
+ addTransaction(txParams: TransactionParams, { actionId, deviceConfirmedOn, method, origin, requireApproval, securityAlertResponse, sendFlowHistory, type, }?: {
190
191
  actionId?: string;
191
192
  deviceConfirmedOn?: WalletDevice;
193
+ method?: string;
192
194
  origin?: string;
193
195
  requireApproval?: boolean | undefined;
194
196
  securityAlertResponse?: Record<string, unknown>;
@@ -242,11 +244,6 @@ export declare class TransactionController extends BaseController<TransactionCon
242
244
  gasPrice: any;
243
245
  estimateGasError: string | undefined;
244
246
  }>;
245
- /**
246
- * Check the status of submitted transactions on the network to determine whether they have
247
- * been included in a block. Any that have been included in a block are marked as confirmed.
248
- */
249
- queryTransactionStatuses(): Promise<void>;
250
247
  /**
251
248
  * Updates an existing transaction in state.
252
249
  *
@@ -359,23 +356,6 @@ export declare class TransactionController extends BaseController<TransactionCon
359
356
  * @returns Whether the transaction is in a final state.
360
357
  */
361
358
  private isLocalFinalState;
362
- /**
363
- * Method to verify the state of a transaction using the Blockchain as a source of truth.
364
- *
365
- * @param meta - The local transaction to verify on the blockchain.
366
- * @returns A tuple containing the updated transaction, and whether or not an update was required.
367
- */
368
- private blockchainTransactionStateReconciler;
369
- /**
370
- * Method to check if a tx has failed according to their receipt
371
- * According to the Web3 docs:
372
- * TRUE if the transaction was successful, FALSE if the EVM reverted the transaction.
373
- * The receipt is not available for pending transactions and returns null.
374
- *
375
- * @param txHash - The transaction hash.
376
- * @returns Whether the transaction has failed.
377
- */
378
- private checkTxReceiptStatusIsFailed;
379
359
  private requestApproval;
380
360
  private getTransaction;
381
361
  private getApprovalId;
@@ -394,6 +374,7 @@ export declare class TransactionController extends BaseController<TransactionCon
394
374
  private getCommonConfiguration;
395
375
  private onIncomingTransactions;
396
376
  private onUpdatedLastFetchedBlockNumbers;
377
+ private onPendingTransactionsUpdate;
397
378
  private generateDappSuggestedGasFees;
398
379
  /**
399
380
  * Validates and adds external provided transaction to state.
@@ -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,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAc3D,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;AAUtC,OAAO,KAAK,EAEV,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,eAAe,EAAqB,MAAM,SAAS,CAAC;AAe7D,eAAO,MAAM,QAAQ,kBAAkB,CAAC;AAExC;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