@metamask-previews/transaction-controller 28.1.1-preview-3301ad9 → 28.1.1-preview-a1db0714
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/dist/TransactionController.js +3 -3
- package/dist/TransactionController.mjs +2 -2
- package/dist/{chunk-GTNVM4MG.js → chunk-ASVFMULG.js} +100 -91
- package/dist/chunk-ASVFMULG.js.map +1 -0
- package/dist/{chunk-RA7LGPVZ.mjs → chunk-BSTN6LDB.mjs} +99 -90
- package/dist/chunk-BSTN6LDB.mjs.map +1 -0
- package/dist/{chunk-Y7ENNK7L.mjs → chunk-QWHMXCGZ.mjs} +13 -6
- package/dist/chunk-QWHMXCGZ.mjs.map +1 -0
- package/dist/{chunk-DTDTOMTB.js → chunk-XC5NBJOF.js} +13 -6
- package/dist/chunk-XC5NBJOF.js.map +1 -0
- package/dist/helpers/IncomingTransactionHelper.js +2 -2
- package/dist/helpers/IncomingTransactionHelper.mjs +1 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/TransactionController.d.ts +6 -7
- package/dist/types/TransactionController.d.ts.map +1 -1
- package/dist/types/helpers/IncomingTransactionHelper.d.ts +2 -1
- package/dist/types/helpers/IncomingTransactionHelper.d.ts.map +1 -1
- package/package.json +4 -1
- package/dist/chunk-DTDTOMTB.js.map +0 -1
- package/dist/chunk-GTNVM4MG.js.map +0 -1
- package/dist/chunk-RA7LGPVZ.mjs.map +0 -1
- package/dist/chunk-Y7ENNK7L.mjs.map +0 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkASVFMULGjs = require('./chunk-ASVFMULG.js');
|
|
8
8
|
require('./chunk-ZNZEJDOE.js');
|
|
9
9
|
require('./chunk-X3KACH5P.js');
|
|
10
10
|
require('./chunk-KT6UAKBB.js');
|
|
@@ -20,7 +20,7 @@ require('./chunk-YVCX6Z75.js');
|
|
|
20
20
|
require('./chunk-TJMQEH57.js');
|
|
21
21
|
require('./chunk-7DJO6UZA.js');
|
|
22
22
|
require('./chunk-2XKEAKQG.js');
|
|
23
|
-
require('./chunk-
|
|
23
|
+
require('./chunk-XC5NBJOF.js');
|
|
24
24
|
require('./chunk-5XQ2KRYL.js');
|
|
25
25
|
require('./chunk-EQT25RSP.js');
|
|
26
26
|
require('./chunk-FDUCRHYT.js');
|
|
@@ -41,5 +41,5 @@ require('./chunk-Z4BLTVTB.js');
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
exports.ApprovalState =
|
|
44
|
+
exports.ApprovalState = _chunkASVFMULGjs.ApprovalState; exports.CANCEL_RATE = _chunkASVFMULGjs.CANCEL_RATE; exports.HARDFORK = _chunkASVFMULGjs.HARDFORK; exports.SPEED_UP_RATE = _chunkASVFMULGjs.SPEED_UP_RATE; exports.TransactionController = _chunkASVFMULGjs.TransactionController;
|
|
45
45
|
//# sourceMappingURL=TransactionController.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
HARDFORK,
|
|
5
5
|
SPEED_UP_RATE,
|
|
6
6
|
TransactionController
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-BSTN6LDB.mjs";
|
|
8
8
|
import "./chunk-NHRBO3LU.mjs";
|
|
9
9
|
import "./chunk-MDRMMUMS.mjs";
|
|
10
10
|
import "./chunk-K4KOSAGM.mjs";
|
|
@@ -20,7 +20,7 @@ import "./chunk-FG74Z3F5.mjs";
|
|
|
20
20
|
import "./chunk-FMRLPVFZ.mjs";
|
|
21
21
|
import "./chunk-SL3GHHKG.mjs";
|
|
22
22
|
import "./chunk-NOHEXQ7Y.mjs";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-QWHMXCGZ.mjs";
|
|
24
24
|
import "./chunk-F6E3TTR3.mjs";
|
|
25
25
|
import "./chunk-CPMTUMMZ.mjs";
|
|
26
26
|
import "./chunk-QZLPYOGC.mjs";
|
|
@@ -45,7 +45,7 @@ var _chunk7DJO6UZAjs = require('./chunk-7DJO6UZA.js');
|
|
|
45
45
|
var _chunk2XKEAKQGjs = require('./chunk-2XKEAKQG.js');
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
var
|
|
48
|
+
var _chunkXC5NBJOFjs = require('./chunk-XC5NBJOF.js');
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
var _chunk5XQ2KRYLjs = require('./chunk-5XQ2KRYL.js');
|
|
@@ -161,7 +161,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
161
161
|
* @param options.getNetworkState - Gets the state of the network controller.
|
|
162
162
|
* @param options.getPermittedAccounts - Get accounts that a given origin has permissions for.
|
|
163
163
|
* @param options.getSavedGasFees - Gets the saved gas fee config.
|
|
164
|
-
* @param options.
|
|
164
|
+
* @param options.getSelectedAccount - Gets the address of the currently selected account.
|
|
165
165
|
* @param options.incomingTransactions - Configuration options for incoming transaction support.
|
|
166
166
|
* @param options.isMultichainEnabled - Enable multichain support.
|
|
167
167
|
* @param options.isSimulationEnabled - Whether new transactions will be automatically simulated.
|
|
@@ -189,7 +189,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
189
189
|
getNetworkState,
|
|
190
190
|
getPermittedAccounts,
|
|
191
191
|
getSavedGasFees,
|
|
192
|
-
|
|
192
|
+
getSelectedAccount,
|
|
193
193
|
incomingTransactions = {},
|
|
194
194
|
isMultichainEnabled = false,
|
|
195
195
|
isSimulationEnabled,
|
|
@@ -259,7 +259,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
259
259
|
this.getCurrentNetworkEIP1559Compatibility = getCurrentNetworkEIP1559Compatibility;
|
|
260
260
|
this.getGasFeeEstimates = getGasFeeEstimates || (() => Promise.resolve({}));
|
|
261
261
|
this.getPermittedAccounts = getPermittedAccounts;
|
|
262
|
-
this.
|
|
262
|
+
this.getSelectedAccount = getSelectedAccount;
|
|
263
263
|
this.getExternalPendingTransactions = getExternalPendingTransactions ?? (() => []);
|
|
264
264
|
this.securityProviderRequest = securityProviderRequest;
|
|
265
265
|
_chunkZ4BLTVTBjs.__privateSet.call(void 0, this, _incomingTransactionOptions, incomingTransactions);
|
|
@@ -456,6 +456,10 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
456
456
|
networkClientId: requestNetworkClientId
|
|
457
457
|
} = {}) {
|
|
458
458
|
_chunkS6VGOPUYjs.projectLogger.call(void 0, "Adding transaction", txParams);
|
|
459
|
+
const selectedAccount = this.getSelectedAccount();
|
|
460
|
+
if (selectedAccount.type !== "eip155:eoa" && selectedAccount.type !== "eip155:erc4337") {
|
|
461
|
+
throw new Error("Selected account is not an EVM account");
|
|
462
|
+
}
|
|
459
463
|
txParams = _chunkUGFBA4GVjs.normalizeTransactionParams.call(void 0, txParams);
|
|
460
464
|
if (requestNetworkClientId && !_chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _multichainTrackingHelper).has(requestNetworkClientId)) {
|
|
461
465
|
throw new Error(
|
|
@@ -470,7 +474,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
470
474
|
if (origin) {
|
|
471
475
|
await _chunkVH47Q6TSjs.validateTransactionOrigin.call(void 0,
|
|
472
476
|
await this.getPermittedAccounts(origin),
|
|
473
|
-
|
|
477
|
+
selectedAccount.address,
|
|
474
478
|
txParams.from,
|
|
475
479
|
origin
|
|
476
480
|
);
|
|
@@ -725,7 +729,9 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
725
729
|
_chunkUGFBA4GVjs.validateGasValues.call(void 0, gasValues);
|
|
726
730
|
}
|
|
727
731
|
_chunkS6VGOPUYjs.projectLogger.call(void 0, "Creating speed up transaction", transactionId, gasValues);
|
|
728
|
-
const transactionMeta = this.
|
|
732
|
+
const transactionMeta = this.state.transactions.find(
|
|
733
|
+
({ id }) => id === transactionId
|
|
734
|
+
);
|
|
729
735
|
if (!transactionMeta) {
|
|
730
736
|
return;
|
|
731
737
|
}
|
|
@@ -774,7 +780,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
774
780
|
unsignedEthTx,
|
|
775
781
|
transactionMeta.txParams.from
|
|
776
782
|
);
|
|
777
|
-
const transactionMetaWithRsv = this.updateTransactionMetaRSV(
|
|
783
|
+
const transactionMetaWithRsv = await this.updateTransactionMetaRSV(
|
|
778
784
|
transactionMeta,
|
|
779
785
|
signedTx
|
|
780
786
|
);
|
|
@@ -1278,10 +1284,10 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1278
1284
|
transactionMeta,
|
|
1279
1285
|
_lodash.pickBy.call(void 0, { hash, status })
|
|
1280
1286
|
);
|
|
1281
|
-
if (
|
|
1287
|
+
if (status === "submitted" /* submitted */) {
|
|
1282
1288
|
updatedTransactionMeta.submittedTime = (/* @__PURE__ */ new Date()).getTime();
|
|
1283
1289
|
}
|
|
1284
|
-
if (
|
|
1290
|
+
if (status === "failed" /* failed */) {
|
|
1285
1291
|
updatedTransactionMeta.error = _chunkUGFBA4GVjs.normalizeTxError.call(void 0, new Error(errorMessage));
|
|
1286
1292
|
}
|
|
1287
1293
|
this.updateTransaction(
|
|
@@ -1637,104 +1643,118 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1637
1643
|
* @param transactionId - The ID of the transaction to approve.
|
|
1638
1644
|
*/
|
|
1639
1645
|
async approveTransaction(transactionId) {
|
|
1646
|
+
const { transactions } = this.state;
|
|
1640
1647
|
const releaseLock = await this.mutex.acquire();
|
|
1648
|
+
const index = transactions.findIndex(({ id }) => transactionId === id);
|
|
1649
|
+
const transactionMeta = transactions[index];
|
|
1650
|
+
const updatedTransactionMeta = _lodash.cloneDeep.call(void 0, transactionMeta);
|
|
1651
|
+
const {
|
|
1652
|
+
txParams: { from },
|
|
1653
|
+
networkClientId
|
|
1654
|
+
} = transactionMeta;
|
|
1641
1655
|
let releaseNonceLock;
|
|
1642
|
-
let txMeta = this.getTransactionOrThrow(transactionId);
|
|
1643
1656
|
try {
|
|
1644
1657
|
if (!this.sign) {
|
|
1645
1658
|
releaseLock();
|
|
1646
|
-
this.failTransaction(
|
|
1659
|
+
this.failTransaction(
|
|
1660
|
+
transactionMeta,
|
|
1661
|
+
new Error("No sign method defined.")
|
|
1662
|
+
);
|
|
1647
1663
|
return "not-approved" /* NotApproved */;
|
|
1648
|
-
} else if (!
|
|
1664
|
+
} else if (!transactionMeta.chainId) {
|
|
1649
1665
|
releaseLock();
|
|
1650
|
-
this.failTransaction(
|
|
1666
|
+
this.failTransaction(transactionMeta, new Error("No chainId defined."));
|
|
1651
1667
|
return "not-approved" /* NotApproved */;
|
|
1652
1668
|
}
|
|
1653
1669
|
if (this.inProcessOfSigning.has(transactionId)) {
|
|
1654
1670
|
_chunkS6VGOPUYjs.projectLogger.call(void 0, "Skipping approval as signing in progress", transactionId);
|
|
1655
1671
|
return "not-approved" /* NotApproved */;
|
|
1656
1672
|
}
|
|
1657
|
-
const [nonce,
|
|
1658
|
-
|
|
1659
|
-
(address) => _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _multichainTrackingHelper).getNonceLock(
|
|
1660
|
-
address,
|
|
1661
|
-
txMeta.networkClientId
|
|
1662
|
-
)
|
|
1673
|
+
const [nonce, releaseNonce] = await _chunkZNZEJDOEjs.getNextNonce.call(void 0,
|
|
1674
|
+
transactionMeta,
|
|
1675
|
+
(address) => _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _multichainTrackingHelper).getNonceLock(address, networkClientId)
|
|
1663
1676
|
);
|
|
1664
|
-
releaseNonceLock =
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
type: "0x2" /* feeMarket */
|
|
1692
|
-
}
|
|
1693
|
-
};
|
|
1694
|
-
if (shouldUpdatePreTxBalance) {
|
|
1695
|
-
draftTxMeta.preTxBalance = preTxBalance;
|
|
1696
|
-
_chunkS6VGOPUYjs.projectLogger.call(void 0, "Updated pre-transaction balance", preTxBalance);
|
|
1697
|
-
}
|
|
1698
|
-
});
|
|
1699
|
-
this.onTransactionStatusChange(txMeta);
|
|
1700
|
-
const rawTx = await this.signTransaction(txMeta, txMeta.txParams);
|
|
1701
|
-
if (!this.beforePublish(txMeta)) {
|
|
1677
|
+
releaseNonceLock = releaseNonce;
|
|
1678
|
+
updatedTransactionMeta.status = "approved" /* approved */;
|
|
1679
|
+
updatedTransactionMeta.txParams = {
|
|
1680
|
+
...updatedTransactionMeta.txParams,
|
|
1681
|
+
nonce,
|
|
1682
|
+
chainId: transactionMeta.chainId
|
|
1683
|
+
};
|
|
1684
|
+
const baseTxParams = {
|
|
1685
|
+
...updatedTransactionMeta.txParams,
|
|
1686
|
+
gasLimit: updatedTransactionMeta.txParams.gas
|
|
1687
|
+
};
|
|
1688
|
+
this.updateTransaction(
|
|
1689
|
+
updatedTransactionMeta,
|
|
1690
|
+
"TransactionController#approveTransaction - Transaction approved"
|
|
1691
|
+
);
|
|
1692
|
+
this.onTransactionStatusChange(updatedTransactionMeta);
|
|
1693
|
+
const isEIP1559 = _chunkUGFBA4GVjs.isEIP1559Transaction.call(void 0, updatedTransactionMeta.txParams);
|
|
1694
|
+
const txParams = isEIP1559 ? {
|
|
1695
|
+
...baseTxParams,
|
|
1696
|
+
estimatedBaseFee: updatedTransactionMeta.txParams.estimatedBaseFee,
|
|
1697
|
+
type: "0x2" /* feeMarket */
|
|
1698
|
+
} : baseTxParams;
|
|
1699
|
+
const rawTx = await this.signTransaction(
|
|
1700
|
+
updatedTransactionMeta,
|
|
1701
|
+
txParams
|
|
1702
|
+
);
|
|
1703
|
+
if (!this.beforePublish(updatedTransactionMeta)) {
|
|
1702
1704
|
_chunkS6VGOPUYjs.projectLogger.call(void 0, "Skipping publishing transaction based on hook");
|
|
1703
1705
|
this.messagingSystem.publish(
|
|
1704
1706
|
`${controllerName}:transactionPublishingSkipped`,
|
|
1705
|
-
|
|
1707
|
+
updatedTransactionMeta
|
|
1706
1708
|
);
|
|
1707
1709
|
return "skipped-via-before-publish-hook" /* SkippedViaBeforePublishHook */;
|
|
1708
1710
|
}
|
|
1709
1711
|
if (!rawTx) {
|
|
1710
1712
|
return "not-approved" /* NotApproved */;
|
|
1711
1713
|
}
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
+
const ethQuery = _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _multichainTrackingHelper).getEthQuery({
|
|
1715
|
+
networkClientId: transactionMeta.networkClientId,
|
|
1716
|
+
chainId: transactionMeta.chainId
|
|
1717
|
+
});
|
|
1718
|
+
if (transactionMeta.type === "swap" /* swap */) {
|
|
1719
|
+
_chunkS6VGOPUYjs.projectLogger.call(void 0, "Determining pre-transaction balance");
|
|
1720
|
+
const preTxBalance = await _controllerutils.query.call(void 0, ethQuery, "getBalance", [from]);
|
|
1721
|
+
updatedTransactionMeta.preTxBalance = preTxBalance;
|
|
1722
|
+
_chunkS6VGOPUYjs.projectLogger.call(void 0,
|
|
1723
|
+
"Updated pre-transaction balance",
|
|
1724
|
+
updatedTransactionMeta.preTxBalance
|
|
1725
|
+
);
|
|
1726
|
+
}
|
|
1727
|
+
_chunkS6VGOPUYjs.projectLogger.call(void 0, "Publishing transaction", txParams);
|
|
1728
|
+
let { transactionHash: hash } = await this.publish(
|
|
1729
|
+
updatedTransactionMeta,
|
|
1730
|
+
rawTx
|
|
1731
|
+
);
|
|
1714
1732
|
if (hash === void 0) {
|
|
1715
1733
|
hash = await this.publishTransaction(ethQuery, rawTx);
|
|
1716
1734
|
}
|
|
1717
1735
|
_chunkS6VGOPUYjs.projectLogger.call(void 0, "Publish successful", hash);
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
});
|
|
1736
|
+
updatedTransactionMeta.hash = hash;
|
|
1737
|
+
updatedTransactionMeta.status = "submitted" /* submitted */;
|
|
1738
|
+
updatedTransactionMeta.submittedTime = (/* @__PURE__ */ new Date()).getTime();
|
|
1739
|
+
this.updateTransaction(
|
|
1740
|
+
updatedTransactionMeta,
|
|
1741
|
+
"TransactionController#approveTransaction - Transaction submitted"
|
|
1742
|
+
);
|
|
1726
1743
|
this.messagingSystem.publish(`${controllerName}:transactionSubmitted`, {
|
|
1727
|
-
transactionMeta:
|
|
1744
|
+
transactionMeta: updatedTransactionMeta
|
|
1728
1745
|
});
|
|
1729
1746
|
this.messagingSystem.publish(
|
|
1730
1747
|
`${controllerName}:transactionFinished`,
|
|
1731
|
-
|
|
1748
|
+
updatedTransactionMeta
|
|
1749
|
+
);
|
|
1750
|
+
_chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _internalEvents).emit(
|
|
1751
|
+
`${updatedTransactionMeta.id}:finished`,
|
|
1752
|
+
updatedTransactionMeta
|
|
1732
1753
|
);
|
|
1733
|
-
|
|
1734
|
-
this.onTransactionStatusChange(txMeta);
|
|
1754
|
+
this.onTransactionStatusChange(updatedTransactionMeta);
|
|
1735
1755
|
return "approved" /* Approved */;
|
|
1736
1756
|
} catch (error) {
|
|
1737
|
-
this.failTransaction(
|
|
1757
|
+
this.failTransaction(transactionMeta, error);
|
|
1738
1758
|
return "not-approved" /* NotApproved */;
|
|
1739
1759
|
} finally {
|
|
1740
1760
|
this.inProcessOfSigning.delete(transactionId);
|
|
@@ -1861,15 +1881,6 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1861
1881
|
const { transactions } = this.state;
|
|
1862
1882
|
return transactions.find(({ id }) => id === transactionId);
|
|
1863
1883
|
}
|
|
1864
|
-
getTransactionOrThrow(transactionId, errorMessagePrefix = "TransactionController") {
|
|
1865
|
-
const txMeta = this.getTransaction(transactionId);
|
|
1866
|
-
if (!txMeta) {
|
|
1867
|
-
throw new Error(
|
|
1868
|
-
`${errorMessagePrefix}: No transaction found with id ${transactionId}`
|
|
1869
|
-
);
|
|
1870
|
-
}
|
|
1871
|
-
return txMeta;
|
|
1872
|
-
}
|
|
1873
1884
|
getApprovalId(txMeta) {
|
|
1874
1885
|
return String(txMeta.id);
|
|
1875
1886
|
}
|
|
@@ -2078,9 +2089,8 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
2078
2089
|
*
|
|
2079
2090
|
* @param transactionMeta - The TransactionMeta object to update.
|
|
2080
2091
|
* @param signedTx - The encompassing type for all transaction types containing r, s, and v values.
|
|
2081
|
-
* @returns The updated TransactionMeta object.
|
|
2082
2092
|
*/
|
|
2083
|
-
updateTransactionMetaRSV(transactionMeta, signedTx) {
|
|
2093
|
+
async updateTransactionMetaRSV(transactionMeta, signedTx) {
|
|
2084
2094
|
const transactionMetaWithRsv = _lodash.cloneDeep.call(void 0, transactionMeta);
|
|
2085
2095
|
for (const key of ["r", "s", "v"]) {
|
|
2086
2096
|
const value = signedTx[key];
|
|
@@ -2128,7 +2138,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
2128
2138
|
return void 0;
|
|
2129
2139
|
}
|
|
2130
2140
|
const transactionMetaWithRsv = {
|
|
2131
|
-
...this.updateTransactionMetaRSV(transactionMeta, signedTx),
|
|
2141
|
+
...await this.updateTransactionMetaRSV(transactionMeta, signedTx),
|
|
2132
2142
|
status: "signed" /* signed */
|
|
2133
2143
|
};
|
|
2134
2144
|
this.updateTransaction(
|
|
@@ -2255,9 +2265,9 @@ createIncomingTransactionHelper_fn = function({
|
|
|
2255
2265
|
etherscanRemoteTransactionSource,
|
|
2256
2266
|
chainId
|
|
2257
2267
|
}) {
|
|
2258
|
-
const incomingTransactionHelper = new (0,
|
|
2268
|
+
const incomingTransactionHelper = new (0, _chunkXC5NBJOFjs.IncomingTransactionHelper)({
|
|
2259
2269
|
blockTracker,
|
|
2260
|
-
getCurrentAccount: this.
|
|
2270
|
+
getCurrentAccount: this.getSelectedAccount,
|
|
2261
2271
|
getLastFetchedBlockNumbers: () => this.state.lastFetchedBlockNumbers,
|
|
2262
2272
|
getChainId: chainId ? () => chainId : this.getChainId.bind(this),
|
|
2263
2273
|
isEnabled: _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _incomingTransactionOptions).isEnabled,
|
|
@@ -2380,14 +2390,14 @@ updateTransactionInternal_fn = function({
|
|
|
2380
2390
|
transactionId,
|
|
2381
2391
|
note,
|
|
2382
2392
|
skipHistory
|
|
2383
|
-
},
|
|
2393
|
+
}, callback) {
|
|
2384
2394
|
let updatedTransactionParams = [];
|
|
2385
2395
|
this.update((state) => {
|
|
2386
2396
|
const index = state.transactions.findIndex(
|
|
2387
2397
|
({ id }) => id === transactionId
|
|
2388
2398
|
);
|
|
2389
2399
|
let transactionMeta2 = state.transactions[index];
|
|
2390
|
-
transactionMeta2 =
|
|
2400
|
+
transactionMeta2 = callback(transactionMeta2) ?? transactionMeta2;
|
|
2391
2401
|
transactionMeta2.txParams = _chunkUGFBA4GVjs.normalizeTransactionParams.call(void 0,
|
|
2392
2402
|
transactionMeta2.txParams
|
|
2393
2403
|
);
|
|
@@ -2407,7 +2417,6 @@ updateTransactionInternal_fn = function({
|
|
|
2407
2417
|
if (updatedTransactionParams.length > 0) {
|
|
2408
2418
|
_chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _onTransactionParamsUpdated, onTransactionParamsUpdated_fn).call(this, transactionMeta, updatedTransactionParams);
|
|
2409
2419
|
}
|
|
2410
|
-
return transactionMeta;
|
|
2411
2420
|
};
|
|
2412
2421
|
_checkIfTransactionParamsUpdated = new WeakSet();
|
|
2413
2422
|
checkIfTransactionParamsUpdated_fn = function(newTransactionMeta) {
|
|
@@ -2542,4 +2551,4 @@ isCustomNetwork_fn = function(networkClientId) {
|
|
|
2542
2551
|
|
|
2543
2552
|
|
|
2544
2553
|
exports.HARDFORK = HARDFORK; exports.CANCEL_RATE = CANCEL_RATE; exports.SPEED_UP_RATE = SPEED_UP_RATE; exports.ApprovalState = ApprovalState; exports.TransactionController = TransactionController;
|
|
2545
|
-
//# sourceMappingURL=chunk-
|
|
2554
|
+
//# sourceMappingURL=chunk-ASVFMULG.js.map
|