@metamask/transaction-controller 12.0.0 → 14.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 +37 -1
- package/dist/PendingTransactionTracker.d.ts +18 -0
- package/dist/PendingTransactionTracker.d.ts.map +1 -0
- package/dist/PendingTransactionTracker.js +144 -0
- package/dist/PendingTransactionTracker.js.map +1 -0
- package/dist/TransactionController.d.ts +22 -34
- package/dist/TransactionController.d.ts.map +1 -1
- package/dist/TransactionController.js +56 -132
- package/dist/TransactionController.js.map +1 -1
- package/dist/external-transactions.js +5 -5
- package/dist/external-transactions.js.map +1 -1
- package/dist/logger.d.ts +1 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +3 -1
- package/dist/logger.js.map +1 -1
- package/dist/types.d.ts +13 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +3 -10
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +4 -45
- package/dist/utils.js.map +1 -1
- package/dist/validation.d.ts +20 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +174 -0
- package/dist/validation.js.map +1 -0
- package/package.json +14 -13
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [14.0.0]
|
|
10
|
+
### Added
|
|
11
|
+
- **BREAKING:** Add required `getPermittedAccounts` argument to constructor, used to validate `from` addresses ([#1722](https://github.com/MetaMask/core/pull/1722))
|
|
12
|
+
- Add `securityProviderRequest` option to constructor ([#1725](https://github.com/MetaMask/core/pull/1725))
|
|
13
|
+
- Add `method` option to `addTransaction` method ([#1725](https://github.com/MetaMask/core/pull/1725))
|
|
14
|
+
- Add `securityProviderRequest` property to TransactionMetaBase ([#1725](https://github.com/MetaMask/core/pull/1725))
|
|
15
|
+
- Add SecurityProviderRequest type ([#1725](https://github.com/MetaMask/core/pull/1725))
|
|
16
|
+
- Update `addTransaction` to set `securityProviderRequest` on transaction metadata when requested to do so ([#1725](https://github.com/MetaMask/core/pull/1725))
|
|
17
|
+
- Update `txParams` validation to validate `chainId` ([#1723](https://github.com/MetaMask/core/pull/1723))
|
|
18
|
+
- Update `addTransaction` to ensure allowed `from` address when `origin` is specified ([#1722](https://github.com/MetaMask/core/pull/1722))
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
- Bump dependency on `@metamask/utils` to ^8.1.0 ([#1639](https://github.com/MetaMask/core/pull/1639))
|
|
22
|
+
- Bump dependency and peer dependency on `@metamask/approval-controller` to ^4.0.0
|
|
23
|
+
- Bump dependency on `@metamask/base-controller` to ^3.2.3
|
|
24
|
+
- Bump dependency on `@metamask/controller-utils` to ^5.0.2
|
|
25
|
+
- Bump dependency and peer dependency on `@metamask/network-controller` to ^14.0.0
|
|
26
|
+
|
|
27
|
+
### Removed
|
|
28
|
+
- **BREAKING:** Remove `interval` config option ([#1746](https://github.com/MetaMask/core/pull/1746))
|
|
29
|
+
- The block tracker (which has its own interval) is now used to poll for pending transactions instead.
|
|
30
|
+
- **BREAKING:** Remove `poll` method ([#1746](https://github.com/MetaMask/core/pull/1746))
|
|
31
|
+
- The block tracker is assumed to be running, TransactionController does not offer a way to stop it.
|
|
32
|
+
- **BREAKING:** Remove `queryTransactionStatuses` method ([#1746](https://github.com/MetaMask/core/pull/1746))
|
|
33
|
+
- This functionality has been moved to a private interface and there is no way to use it externally.
|
|
34
|
+
|
|
35
|
+
## [13.0.0]
|
|
36
|
+
### Changed
|
|
37
|
+
- **BREAKING**: Add required `getCurrentAccountEIP1559Compatibility` and `getCurrentNetworkEIP1559Compatibility` callback arguments to constructor ([#1693](https://github.com/MetaMask/core/pull/1693))
|
|
38
|
+
- Update `validateTxParams` to throw standardised errors using the `@metamask/rpc-errors` package ([#1690](https://github.com/MetaMask/core/pull/1690))
|
|
39
|
+
- The dependency `eth-rpc-errors` has been replaced by `@metamask/rpc-errors`
|
|
40
|
+
- Preserve `type` transaction parameter for legacy transactions ([#1713](https://github.com/MetaMask/core/pull/1713))
|
|
41
|
+
- Update TypeScript to v4.8.x ([#1718](https://github.com/MetaMask/core/pull/1718))
|
|
42
|
+
|
|
9
43
|
## [12.0.0]
|
|
10
44
|
### Changed
|
|
11
45
|
- **BREAKING**: Use only `chainId` to determine if a transaction belongs to the current network ([#1633](https://github.com/MetaMask/core/pull/1633))
|
|
@@ -203,7 +237,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
203
237
|
|
|
204
238
|
All changes listed after this point were applied to this package following the monorepo conversion.
|
|
205
239
|
|
|
206
|
-
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@
|
|
240
|
+
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@14.0.0...HEAD
|
|
241
|
+
[14.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@13.0.0...@metamask/transaction-controller@14.0.0
|
|
242
|
+
[13.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@12.0.0...@metamask/transaction-controller@13.0.0
|
|
207
243
|
[12.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@11.1.0...@metamask/transaction-controller@12.0.0
|
|
208
244
|
[11.1.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@11.0.0...@metamask/transaction-controller@11.1.0
|
|
209
245
|
[11.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@10.0.0...@metamask/transaction-controller@11.0.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=PendingTransactionTracker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PendingTransactionTracker.js","sourceRoot":"","sources":["../src/PendingTransactionTracker.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;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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,11 +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;
|
|
100
|
+
private readonly getCurrentAccountEIP1559Compatibility;
|
|
101
|
+
private readonly getCurrentNetworkEIP1559Compatibility;
|
|
102
|
+
private readonly getPermittedAccounts;
|
|
103
|
+
private readonly getSelectedAddress;
|
|
102
104
|
private readonly messagingSystem;
|
|
103
105
|
private readonly incomingTransactionHelper;
|
|
106
|
+
private readonly securityProviderRequest?;
|
|
107
|
+
private readonly pendingTransactionTracker;
|
|
104
108
|
private failTransaction;
|
|
105
109
|
private registryLookup;
|
|
106
110
|
/**
|
|
@@ -122,7 +126,10 @@ export declare class TransactionController extends BaseController<TransactionCon
|
|
|
122
126
|
* @param options.blockTracker - The block tracker used to poll for new blocks data.
|
|
123
127
|
* @param options.disableHistory - Whether to disable storing history in transaction metadata.
|
|
124
128
|
* @param options.disableSendFlowHistory - Explicitly disable transaction metadata history.
|
|
129
|
+
* @param options.getCurrentAccountEIP1559Compatibility - Whether or not the account supports EIP-1559.
|
|
130
|
+
* @param options.getCurrentNetworkEIP1559Compatibility - Whether or not the network supports EIP-1559.
|
|
125
131
|
* @param options.getNetworkState - Gets the state of the network controller.
|
|
132
|
+
* @param options.getPermittedAccounts - Get accounts that a given origin has permissions for.
|
|
126
133
|
* @param options.getSelectedAddress - Gets the address of the currently selected account.
|
|
127
134
|
* @param options.incomingTransactions - Configuration options for incoming transaction support.
|
|
128
135
|
* @param options.incomingTransactions.includeTokenTransfers - Whether or not to include ERC20 token transfers.
|
|
@@ -132,14 +139,18 @@ export declare class TransactionController extends BaseController<TransactionCon
|
|
|
132
139
|
* @param options.messenger - The controller messenger.
|
|
133
140
|
* @param options.onNetworkStateChange - Allows subscribing to network controller state changes.
|
|
134
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.
|
|
135
143
|
* @param config - Initial options used to configure this controller.
|
|
136
144
|
* @param state - Initial state to set on this controller.
|
|
137
145
|
*/
|
|
138
|
-
constructor({ blockTracker, disableHistory, disableSendFlowHistory, getNetworkState, getSelectedAddress, incomingTransactions, messenger, onNetworkStateChange, provider, }: {
|
|
146
|
+
constructor({ blockTracker, disableHistory, disableSendFlowHistory, getCurrentAccountEIP1559Compatibility, getCurrentNetworkEIP1559Compatibility, getNetworkState, getPermittedAccounts, getSelectedAddress, incomingTransactions, messenger, onNetworkStateChange, provider, securityProviderRequest, }: {
|
|
139
147
|
blockTracker: BlockTracker;
|
|
140
148
|
disableHistory: boolean;
|
|
141
149
|
disableSendFlowHistory: boolean;
|
|
150
|
+
getCurrentAccountEIP1559Compatibility: () => Promise<boolean>;
|
|
151
|
+
getCurrentNetworkEIP1559Compatibility: () => Promise<boolean>;
|
|
142
152
|
getNetworkState: () => NetworkState;
|
|
153
|
+
getPermittedAccounts: (origin?: string) => Promise<string[]>;
|
|
143
154
|
getSelectedAddress: () => string;
|
|
144
155
|
incomingTransactions: {
|
|
145
156
|
includeTokenTransfers?: boolean;
|
|
@@ -150,13 +161,8 @@ export declare class TransactionController extends BaseController<TransactionCon
|
|
|
150
161
|
messenger: TransactionControllerMessenger;
|
|
151
162
|
onNetworkStateChange: (listener: (state: NetworkState) => void) => void;
|
|
152
163
|
provider: Provider;
|
|
164
|
+
securityProviderRequest?: SecurityProviderRequest;
|
|
153
165
|
}, config?: Partial<TransactionConfig>, state?: Partial<TransactionState>);
|
|
154
|
-
/**
|
|
155
|
-
* Starts a new polling interval.
|
|
156
|
-
*
|
|
157
|
-
* @param interval - The polling interval used to fetch new transaction statuses.
|
|
158
|
-
*/
|
|
159
|
-
poll(interval?: number): Promise<void>;
|
|
160
166
|
/**
|
|
161
167
|
* Handle new method data request.
|
|
162
168
|
*
|
|
@@ -173,6 +179,7 @@ export declare class TransactionController extends BaseController<TransactionCon
|
|
|
173
179
|
* @param opts - Additional options to control how the transaction is added.
|
|
174
180
|
* @param opts.actionId - Unique ID to prevent duplicate requests.
|
|
175
181
|
* @param opts.deviceConfirmedOn - An enum to indicate what device confirmed the transaction.
|
|
182
|
+
* @param opts.method - RPC method that requested the transaction.
|
|
176
183
|
* @param opts.origin - The origin of the transaction request, such as a dApp hostname.
|
|
177
184
|
* @param opts.requireApproval - Whether the transaction requires approval by the user, defaults to true unless explicitly disabled.
|
|
178
185
|
* @param opts.securityAlertResponse - Response from security validator.
|
|
@@ -180,9 +187,10 @@ export declare class TransactionController extends BaseController<TransactionCon
|
|
|
180
187
|
* @param opts.type - Type of transaction to add, such as 'cancel' or 'swap'.
|
|
181
188
|
* @returns Object containing a promise resolving to the transaction hash if approved.
|
|
182
189
|
*/
|
|
183
|
-
addTransaction(txParams: TransactionParams, { actionId, deviceConfirmedOn, origin, requireApproval, securityAlertResponse, sendFlowHistory, type, }?: {
|
|
190
|
+
addTransaction(txParams: TransactionParams, { actionId, deviceConfirmedOn, method, origin, requireApproval, securityAlertResponse, sendFlowHistory, type, }?: {
|
|
184
191
|
actionId?: string;
|
|
185
192
|
deviceConfirmedOn?: WalletDevice;
|
|
193
|
+
method?: string;
|
|
186
194
|
origin?: string;
|
|
187
195
|
requireApproval?: boolean | undefined;
|
|
188
196
|
securityAlertResponse?: Record<string, unknown>;
|
|
@@ -236,11 +244,6 @@ export declare class TransactionController extends BaseController<TransactionCon
|
|
|
236
244
|
gasPrice: any;
|
|
237
245
|
estimateGasError: string | undefined;
|
|
238
246
|
}>;
|
|
239
|
-
/**
|
|
240
|
-
* Check the status of submitted transactions on the network to determine whether they have
|
|
241
|
-
* been included in a block. Any that have been included in a block are marked as confirmed.
|
|
242
|
-
*/
|
|
243
|
-
queryTransactionStatuses(): Promise<void>;
|
|
244
247
|
/**
|
|
245
248
|
* Updates an existing transaction in state.
|
|
246
249
|
*
|
|
@@ -353,23 +356,6 @@ export declare class TransactionController extends BaseController<TransactionCon
|
|
|
353
356
|
* @returns Whether the transaction is in a final state.
|
|
354
357
|
*/
|
|
355
358
|
private isLocalFinalState;
|
|
356
|
-
/**
|
|
357
|
-
* Method to verify the state of a transaction using the Blockchain as a source of truth.
|
|
358
|
-
*
|
|
359
|
-
* @param meta - The local transaction to verify on the blockchain.
|
|
360
|
-
* @returns A tuple containing the updated transaction, and whether or not an update was required.
|
|
361
|
-
*/
|
|
362
|
-
private blockchainTransactionStateReconciler;
|
|
363
|
-
/**
|
|
364
|
-
* Method to check if a tx has failed according to their receipt
|
|
365
|
-
* According to the Web3 docs:
|
|
366
|
-
* TRUE if the transaction was successful, FALSE if the EVM reverted the transaction.
|
|
367
|
-
* The receipt is not available for pending transactions and returns null.
|
|
368
|
-
*
|
|
369
|
-
* @param txHash - The transaction hash.
|
|
370
|
-
* @returns Whether the transaction has failed.
|
|
371
|
-
*/
|
|
372
|
-
private checkTxReceiptStatusIsFailed;
|
|
373
359
|
private requestApproval;
|
|
374
360
|
private getTransaction;
|
|
375
361
|
private getApprovalId;
|
|
@@ -388,6 +374,7 @@ export declare class TransactionController extends BaseController<TransactionCon
|
|
|
388
374
|
private getCommonConfiguration;
|
|
389
375
|
private onIncomingTransactions;
|
|
390
376
|
private onUpdatedLastFetchedBlockNumbers;
|
|
377
|
+
private onPendingTransactionsUpdate;
|
|
391
378
|
private generateDappSuggestedGasFees;
|
|
392
379
|
/**
|
|
393
380
|
* Validates and adds external provided transaction to state.
|
|
@@ -424,6 +411,7 @@ export declare class TransactionController extends BaseController<TransactionCon
|
|
|
424
411
|
* @param signedTx - The encompassing type for all transaction types containing r, s, and v values.
|
|
425
412
|
*/
|
|
426
413
|
private updateTransactionMetaRSV;
|
|
414
|
+
private getEIP1559Compatibility;
|
|
427
415
|
}
|
|
428
416
|
export default TransactionController;
|
|
429
417
|
//# sourceMappingURL=TransactionController.d.ts.map
|
|
@@ -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;
|
|
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,MAA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