@metamask/transaction-controller 36.1.0 → 37.1.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 +47 -1
- package/dist/TransactionController.cjs +2071 -0
- package/dist/TransactionController.cjs.map +1 -0
- package/dist/{types/TransactionController.d.ts → TransactionController.d.cts} +19 -26
- package/dist/TransactionController.d.cts.map +1 -0
- package/dist/TransactionController.d.mts +828 -0
- package/dist/TransactionController.d.mts.map +1 -0
- package/dist/TransactionController.mjs +2072 -44
- package/dist/TransactionController.mjs.map +1 -1
- package/dist/constants.cjs +170 -0
- package/dist/constants.cjs.map +1 -0
- package/dist/{types/constants.d.ts → constants.d.cts} +1 -1
- package/dist/constants.d.cts.map +1 -0
- package/dist/constants.d.mts +143 -0
- package/dist/constants.d.mts.map +1 -0
- package/dist/constants.mjs +165 -18
- package/dist/constants.mjs.map +1 -1
- package/dist/errors.cjs +30 -0
- package/dist/{chunk-HMOSP33F.js.map → errors.cjs.map} +1 -1
- package/dist/{types/errors.d.ts → errors.d.cts} +2 -2
- package/dist/errors.d.cts.map +1 -0
- package/dist/errors.d.mts +15 -0
- package/dist/errors.d.mts.map +1 -0
- package/dist/errors.mjs +22 -14
- package/dist/errors.mjs.map +1 -1
- package/dist/gas-flows/DefaultGasFeeFlow.cjs +87 -0
- package/dist/gas-flows/DefaultGasFeeFlow.cjs.map +1 -0
- package/dist/{types/gas-flows/DefaultGasFeeFlow.d.ts → gas-flows/DefaultGasFeeFlow.d.cts} +2 -2
- package/dist/gas-flows/DefaultGasFeeFlow.d.cts.map +1 -0
- package/dist/gas-flows/DefaultGasFeeFlow.d.mts +10 -0
- package/dist/gas-flows/DefaultGasFeeFlow.d.mts.map +1 -0
- package/dist/gas-flows/DefaultGasFeeFlow.mjs +81 -13
- package/dist/gas-flows/DefaultGasFeeFlow.mjs.map +1 -1
- package/dist/gas-flows/LineaGasFeeFlow.cjs +102 -0
- package/dist/gas-flows/LineaGasFeeFlow.cjs.map +1 -0
- package/dist/{types/gas-flows/LineaGasFeeFlow.d.ts → gas-flows/LineaGasFeeFlow.d.cts} +2 -2
- package/dist/gas-flows/LineaGasFeeFlow.d.cts.map +1 -0
- package/dist/gas-flows/LineaGasFeeFlow.d.mts +12 -0
- package/dist/gas-flows/LineaGasFeeFlow.d.mts.map +1 -0
- package/dist/gas-flows/LineaGasFeeFlow.mjs +96 -14
- package/dist/gas-flows/LineaGasFeeFlow.mjs.map +1 -1
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.cjs +29 -0
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.cjs.map +1 -0
- package/dist/{types/gas-flows/OptimismLayer1GasFeeFlow.d.ts → gas-flows/OptimismLayer1GasFeeFlow.d.cts} +3 -3
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.d.cts.map +1 -0
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.d.mts +10 -0
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.d.mts.map +1 -0
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.mjs +24 -10
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.mjs.map +1 -1
- package/dist/gas-flows/OracleLayer1GasFeeFlow.cjs +92 -0
- package/dist/gas-flows/OracleLayer1GasFeeFlow.cjs.map +1 -0
- package/dist/{types/gas-flows/OracleLayer1GasFeeFlow.d.ts → gas-flows/OracleLayer1GasFeeFlow.d.cts} +3 -3
- package/dist/gas-flows/OracleLayer1GasFeeFlow.d.cts.map +1 -0
- package/dist/gas-flows/OracleLayer1GasFeeFlow.d.mts +12 -0
- package/dist/gas-flows/OracleLayer1GasFeeFlow.d.mts.map +1 -0
- package/dist/gas-flows/OracleLayer1GasFeeFlow.mjs +88 -7
- package/dist/gas-flows/OracleLayer1GasFeeFlow.mjs.map +1 -1
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.cjs +21 -0
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.cjs.map +1 -0
- package/dist/{types/gas-flows/ScrollLayer1GasFeeFlow.d.ts → gas-flows/ScrollLayer1GasFeeFlow.d.cts} +3 -3
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.d.cts.map +1 -0
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.d.mts +10 -0
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.d.mts.map +1 -0
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.mjs +16 -10
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.mjs.map +1 -1
- package/dist/gas-flows/TestGasFeeFlow.cjs +73 -0
- package/dist/{chunk-FMRLPVFZ.mjs.map → gas-flows/TestGasFeeFlow.cjs.map} +1 -1
- package/dist/{types/gas-flows/TestGasFeeFlow.d.ts → gas-flows/TestGasFeeFlow.d.cts} +2 -2
- package/dist/gas-flows/TestGasFeeFlow.d.cts.map +1 -0
- package/dist/gas-flows/TestGasFeeFlow.d.mts +12 -0
- package/dist/gas-flows/TestGasFeeFlow.d.mts.map +1 -0
- package/dist/gas-flows/TestGasFeeFlow.mjs +67 -7
- package/dist/gas-flows/TestGasFeeFlow.mjs.map +1 -1
- package/dist/helpers/EtherscanRemoteTransactionSource.cjs +149 -0
- package/dist/helpers/EtherscanRemoteTransactionSource.cjs.map +1 -0
- package/dist/{types/helpers/EtherscanRemoteTransactionSource.d.ts → helpers/EtherscanRemoteTransactionSource.d.cts} +3 -3
- package/dist/helpers/EtherscanRemoteTransactionSource.d.cts.map +1 -0
- package/dist/helpers/EtherscanRemoteTransactionSource.d.mts +15 -0
- package/dist/helpers/EtherscanRemoteTransactionSource.d.mts.map +1 -0
- package/dist/helpers/EtherscanRemoteTransactionSource.mjs +147 -10
- package/dist/helpers/EtherscanRemoteTransactionSource.mjs.map +1 -1
- package/dist/helpers/GasFeePoller.cjs +185 -0
- package/dist/helpers/GasFeePoller.cjs.map +1 -0
- package/dist/{types/helpers/GasFeePoller.d.ts → helpers/GasFeePoller.d.cts} +7 -7
- package/dist/helpers/GasFeePoller.d.cts.map +1 -0
- package/dist/helpers/GasFeePoller.d.mts +35 -0
- package/dist/helpers/GasFeePoller.d.mts.map +1 -0
- package/dist/helpers/GasFeePoller.mjs +183 -10
- package/dist/helpers/GasFeePoller.mjs.map +1 -1
- package/dist/helpers/IncomingTransactionHelper.cjs +199 -0
- package/dist/helpers/IncomingTransactionHelper.cjs.map +1 -0
- package/dist/{types/helpers/IncomingTransactionHelper.d.ts → helpers/IncomingTransactionHelper.d.cts} +6 -6
- package/dist/helpers/IncomingTransactionHelper.d.cts.map +1 -0
- package/dist/helpers/IncomingTransactionHelper.d.mts +40 -0
- package/dist/helpers/IncomingTransactionHelper.d.mts.map +1 -0
- package/dist/helpers/IncomingTransactionHelper.mjs +190 -7
- package/dist/helpers/IncomingTransactionHelper.mjs.map +1 -1
- package/dist/helpers/MultichainTrackingHelper.cjs +284 -0
- package/dist/helpers/MultichainTrackingHelper.cjs.map +1 -0
- package/dist/{types/helpers/MultichainTrackingHelper.d.ts → helpers/MultichainTrackingHelper.d.cts} +8 -8
- package/dist/helpers/MultichainTrackingHelper.d.cts.map +1 -0
- package/dist/helpers/MultichainTrackingHelper.d.mts +76 -0
- package/dist/helpers/MultichainTrackingHelper.d.mts.map +1 -0
- package/dist/helpers/MultichainTrackingHelper.mjs +282 -11
- package/dist/helpers/MultichainTrackingHelper.mjs.map +1 -1
- package/dist/helpers/PendingTransactionTracker.cjs +327 -0
- package/dist/helpers/PendingTransactionTracker.cjs.map +1 -0
- package/dist/{types/helpers/PendingTransactionTracker.d.ts → helpers/PendingTransactionTracker.d.cts} +7 -8
- package/dist/helpers/PendingTransactionTracker.d.cts.map +1 -0
- package/dist/helpers/PendingTransactionTracker.d.mts +42 -0
- package/dist/helpers/PendingTransactionTracker.d.mts.map +1 -0
- package/dist/helpers/PendingTransactionTracker.mjs +319 -8
- package/dist/helpers/PendingTransactionTracker.mjs.map +1 -1
- package/dist/index.cjs +32 -0
- package/dist/index.cjs.map +1 -0
- package/dist/{types/index.d.ts → index.d.cts} +11 -10
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +11 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +7 -76
- package/dist/index.mjs.map +1 -1
- package/dist/logger.cjs +9 -0
- package/dist/logger.cjs.map +1 -0
- package/dist/{types/logger.d.ts → logger.d.cts} +2 -2
- package/dist/logger.d.cts.map +1 -0
- package/dist/logger.d.mts +6 -0
- package/dist/logger.d.mts.map +1 -0
- package/dist/logger.mjs +5 -11
- package/dist/logger.mjs.map +1 -1
- package/dist/types.cjs +308 -0
- package/dist/types.cjs.map +1 -0
- package/dist/{types/types.d.ts → types.d.cts} +35 -35
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.mts +1027 -0
- package/dist/types.d.mts.map +1 -0
- package/dist/types.mjs +304 -23
- package/dist/types.mjs.map +1 -1
- package/dist/utils/etherscan.cjs +111 -0
- package/dist/utils/etherscan.cjs.map +1 -0
- package/dist/{types/utils/etherscan.d.ts → utils/etherscan.d.cts} +2 -2
- package/dist/utils/etherscan.d.cts.map +1 -0
- package/dist/utils/etherscan.d.mts +71 -0
- package/dist/utils/etherscan.d.mts.map +1 -0
- package/dist/utils/etherscan.mjs +104 -13
- package/dist/utils/etherscan.mjs.map +1 -1
- package/dist/utils/external-transactions.cjs +36 -0
- package/dist/utils/external-transactions.cjs.map +1 -0
- package/dist/{types/utils/external-transactions.d.ts → utils/external-transactions.d.cts} +2 -2
- package/dist/utils/external-transactions.d.cts.map +1 -0
- package/dist/utils/external-transactions.d.mts +10 -0
- package/dist/utils/external-transactions.d.mts.map +1 -0
- package/dist/utils/external-transactions.mjs +31 -8
- package/dist/utils/external-transactions.mjs.map +1 -1
- package/dist/utils/gas-fees.cjs +208 -0
- package/dist/utils/gas-fees.cjs.map +1 -0
- package/dist/{types/utils/gas-fees.d.ts → utils/gas-fees.d.cts} +5 -5
- package/dist/utils/gas-fees.d.cts.map +1 -0
- package/dist/utils/gas-fees.d.mts +26 -0
- package/dist/utils/gas-fees.d.mts.map +1 -0
- package/dist/utils/gas-fees.mjs +202 -15
- package/dist/utils/gas-fees.mjs.map +1 -1
- package/dist/utils/gas-flow.cjs +76 -0
- package/dist/utils/gas-flow.cjs.map +1 -0
- package/dist/{types/utils/gas-flow.d.ts → utils/gas-flow.d.cts} +5 -5
- package/dist/utils/gas-flow.d.cts.map +1 -0
- package/dist/utils/gas-flow.d.mts +26 -0
- package/dist/utils/gas-flow.d.mts.map +1 -0
- package/dist/utils/gas-flow.mjs +70 -10
- package/dist/utils/gas-flow.mjs.map +1 -1
- package/dist/utils/gas.cjs +112 -0
- package/dist/utils/gas.cjs.map +1 -0
- package/dist/{types/utils/gas.d.ts → utils/gas.d.cts} +4 -4
- package/dist/utils/gas.d.cts.map +1 -0
- package/dist/utils/gas.d.mts +28 -0
- package/dist/utils/gas.d.mts.map +1 -0
- package/dist/utils/gas.mjs +105 -19
- package/dist/utils/gas.mjs.map +1 -1
- package/dist/utils/history.cjs +164 -0
- package/dist/utils/history.cjs.map +1 -0
- package/dist/{types/utils/history.d.ts → utils/history.d.cts} +2 -2
- package/dist/utils/history.d.cts.map +1 -0
- package/dist/utils/history.d.mts +29 -0
- package/dist/utils/history.d.mts.map +1 -0
- package/dist/utils/history.mjs +163 -13
- package/dist/utils/history.mjs.map +1 -1
- package/dist/utils/layer1-gas-fee-flow.cjs +59 -0
- package/dist/utils/layer1-gas-fee-flow.cjs.map +1 -0
- package/dist/{types/utils/layer1-gas-fee-flow.d.ts → utils/layer1-gas-fee-flow.d.cts} +4 -4
- package/dist/utils/layer1-gas-fee-flow.d.cts.map +1 -0
- package/dist/utils/layer1-gas-fee-flow.d.mts +25 -0
- package/dist/utils/layer1-gas-fee-flow.d.mts.map +1 -0
- package/dist/utils/layer1-gas-fee-flow.mjs +53 -10
- package/dist/utils/layer1-gas-fee-flow.mjs.map +1 -1
- package/dist/utils/nonce.cjs +66 -0
- package/dist/utils/nonce.cjs.map +1 -0
- package/dist/{types/utils/nonce.d.ts → utils/nonce.d.cts} +3 -3
- package/dist/utils/nonce.d.cts.map +1 -0
- package/dist/utils/nonce.d.mts +21 -0
- package/dist/utils/nonce.d.mts.map +1 -0
- package/dist/utils/nonce.mjs +60 -10
- package/dist/utils/nonce.mjs.map +1 -1
- package/dist/utils/retry.cjs +89 -0
- package/dist/utils/retry.cjs.map +1 -0
- package/dist/{types/utils/retry.d.ts → utils/retry.d.cts} +3 -3
- package/dist/utils/retry.d.cts.map +1 -0
- package/dist/utils/retry.d.mts +11 -0
- package/dist/utils/retry.d.mts.map +1 -0
- package/dist/utils/retry.mjs +84 -7
- package/dist/utils/retry.mjs.map +1 -1
- package/dist/utils/simulation-api.cjs +72 -0
- package/dist/utils/simulation-api.cjs.map +1 -0
- package/dist/{types/utils/simulation-api.d.ts → utils/simulation-api.d.cts} +2 -2
- package/dist/utils/simulation-api.d.cts.map +1 -0
- package/dist/utils/simulation-api.d.mts +107 -0
- package/dist/utils/simulation-api.d.mts.map +1 -0
- package/dist/utils/simulation-api.mjs +67 -10
- package/dist/utils/simulation-api.mjs.map +1 -1
- package/dist/utils/simulation.cjs +443 -0
- package/dist/utils/simulation.cjs.map +1 -0
- package/dist/{types/utils/simulation.d.ts → utils/simulation.d.cts} +6 -6
- package/dist/utils/simulation.d.cts.map +1 -0
- package/dist/utils/simulation.d.mts +46 -0
- package/dist/utils/simulation.d.mts.map +1 -0
- package/dist/utils/simulation.mjs +436 -15
- package/dist/utils/simulation.mjs.map +1 -1
- package/dist/utils/swaps.cjs +309 -0
- package/dist/utils/swaps.cjs.map +1 -0
- package/dist/{types/utils/swaps.d.ts → utils/swaps.d.cts} +5 -5
- package/dist/utils/swaps.d.cts.map +1 -0
- package/dist/utils/swaps.d.mts +84 -0
- package/dist/utils/swaps.d.mts.map +1 -0
- package/dist/utils/swaps.mjs +303 -22
- package/dist/utils/swaps.mjs.map +1 -1
- package/dist/utils/transaction-type.cjs +115 -0
- package/dist/utils/transaction-type.cjs.map +1 -0
- package/dist/{types/utils/transaction-type.d.ts → utils/transaction-type.d.cts} +3 -3
- package/dist/utils/transaction-type.d.cts.map +1 -0
- package/dist/utils/transaction-type.d.mts +14 -0
- package/dist/utils/transaction-type.d.mts.map +1 -0
- package/dist/utils/transaction-type.mjs +110 -10
- package/dist/utils/transaction-type.mjs.map +1 -1
- package/dist/utils/utils.cjs +151 -0
- package/dist/utils/utils.cjs.map +1 -0
- package/dist/{types/utils/utils.d.ts → utils/utils.d.cts} +2 -2
- package/dist/utils/utils.d.cts.map +1 -0
- package/dist/utils/utils.d.mts +52 -0
- package/dist/utils/utils.d.mts.map +1 -0
- package/dist/utils/utils.mjs +139 -21
- package/dist/utils/utils.mjs.map +1 -1
- package/dist/utils/validation.cjs +267 -0
- package/dist/{chunk-4OYPDGHO.js.map → utils/validation.cjs.map} +1 -1
- package/dist/{types/utils/validation.d.ts → utils/validation.d.cts} +2 -2
- package/dist/utils/validation.d.cts.map +1 -0
- package/dist/utils/validation.d.mts +20 -0
- package/dist/utils/validation.d.mts.map +1 -0
- package/dist/utils/validation.mjs +261 -11
- package/dist/utils/validation.mjs.map +1 -1
- package/package.json +20 -15
- package/dist/TransactionController.js +0 -46
- package/dist/TransactionController.js.map +0 -1
- package/dist/chunk-2XKEAKQG.js +0 -55
- package/dist/chunk-2XKEAKQG.js.map +0 -1
- package/dist/chunk-3AVRGHUO.mjs +0 -360
- package/dist/chunk-3AVRGHUO.mjs.map +0 -1
- package/dist/chunk-3ZV5YEUV.mjs +0 -239
- package/dist/chunk-3ZV5YEUV.mjs.map +0 -1
- package/dist/chunk-4OYPDGHO.js +0 -201
- package/dist/chunk-4V4XIPCI.mjs +0 -338
- package/dist/chunk-4V4XIPCI.mjs.map +0 -1
- package/dist/chunk-5G6OHAXI.mjs +0 -137
- package/dist/chunk-5G6OHAXI.mjs.map +0 -1
- package/dist/chunk-5HYWLTVQ.js +0 -228
- package/dist/chunk-5HYWLTVQ.js.map +0 -1
- package/dist/chunk-5QVDIVJH.js +0 -68
- package/dist/chunk-5QVDIVJH.js.map +0 -1
- package/dist/chunk-6B5BEO3R.mjs +0 -399
- package/dist/chunk-6B5BEO3R.mjs.map +0 -1
- package/dist/chunk-6DDVVUJC.mjs +0 -50
- package/dist/chunk-6DDVVUJC.mjs.map +0 -1
- package/dist/chunk-6OLJWLKK.js +0 -338
- package/dist/chunk-6OLJWLKK.js.map +0 -1
- package/dist/chunk-7LXE4KHV.js +0 -40
- package/dist/chunk-7LXE4KHV.js.map +0 -1
- package/dist/chunk-7NMV2NPM.js +0 -172
- package/dist/chunk-7NMV2NPM.js.map +0 -1
- package/dist/chunk-AWIJZAW3.mjs +0 -112
- package/dist/chunk-AWIJZAW3.mjs.map +0 -1
- package/dist/chunk-BZV72SCF.js +0 -226
- package/dist/chunk-BZV72SCF.js.map +0 -1
- package/dist/chunk-EGQCE3FK.mjs +0 -85
- package/dist/chunk-EGQCE3FK.mjs.map +0 -1
- package/dist/chunk-EHWAY6XU.js +0 -112
- package/dist/chunk-EHWAY6XU.js.map +0 -1
- package/dist/chunk-EKJXGERC.mjs +0 -172
- package/dist/chunk-EKJXGERC.mjs.map +0 -1
- package/dist/chunk-FG74Z3F5.mjs +0 -102
- package/dist/chunk-FG74Z3F5.mjs.map +0 -1
- package/dist/chunk-FMRLPVFZ.mjs +0 -66
- package/dist/chunk-FRKQ3Z2L.mjs +0 -40
- package/dist/chunk-FRKQ3Z2L.mjs.map +0 -1
- package/dist/chunk-HMOSP33F.js +0 -36
- package/dist/chunk-HQSNKCXI.mjs +0 -36
- package/dist/chunk-HQSNKCXI.mjs.map +0 -1
- package/dist/chunk-JIFPK37W.mjs +0 -257
- package/dist/chunk-JIFPK37W.mjs.map +0 -1
- package/dist/chunk-JOQK7A5G.mjs +0 -68
- package/dist/chunk-JOQK7A5G.mjs.map +0 -1
- package/dist/chunk-K4KOSAGM.mjs +0 -61
- package/dist/chunk-K4KOSAGM.mjs.map +0 -1
- package/dist/chunk-KG4UW4K4.mjs +0 -88
- package/dist/chunk-KG4UW4K4.mjs.map +0 -1
- package/dist/chunk-KT6UAKBB.js +0 -61
- package/dist/chunk-KT6UAKBB.js.map +0 -1
- package/dist/chunk-KTGMNUTQ.js +0 -106
- package/dist/chunk-KTGMNUTQ.js.map +0 -1
- package/dist/chunk-KYRW4BLA.mjs +0 -121
- package/dist/chunk-KYRW4BLA.mjs.map +0 -1
- package/dist/chunk-LFFYCDHB.mjs +0 -92
- package/dist/chunk-LFFYCDHB.mjs.map +0 -1
- package/dist/chunk-NNCUD3QF.js +0 -360
- package/dist/chunk-NNCUD3QF.js.map +0 -1
- package/dist/chunk-NNHSNPT2.mjs +0 -67
- package/dist/chunk-NNHSNPT2.mjs.map +0 -1
- package/dist/chunk-NOHEXQ7Y.mjs +0 -55
- package/dist/chunk-NOHEXQ7Y.mjs.map +0 -1
- package/dist/chunk-NYKRCWBG.js +0 -31
- package/dist/chunk-NYKRCWBG.js.map +0 -1
- package/dist/chunk-O6ZZVIFH.mjs +0 -176
- package/dist/chunk-O6ZZVIFH.mjs.map +0 -1
- package/dist/chunk-PRUNMTRD.js +0 -50
- package/dist/chunk-PRUNMTRD.js.map +0 -1
- package/dist/chunk-PSZ34BI5.js +0 -92
- package/dist/chunk-PSZ34BI5.js.map +0 -1
- package/dist/chunk-QKV7E5BO.js +0 -257
- package/dist/chunk-QKV7E5BO.js.map +0 -1
- package/dist/chunk-RHDPOIS4.js +0 -239
- package/dist/chunk-RHDPOIS4.js.map +0 -1
- package/dist/chunk-S6VGOPUY.js +0 -14
- package/dist/chunk-S6VGOPUY.js.map +0 -1
- package/dist/chunk-SD6CWFDF.js +0 -88
- package/dist/chunk-SD6CWFDF.js.map +0 -1
- package/dist/chunk-SFFOC25Q.mjs +0 -226
- package/dist/chunk-SFFOC25Q.mjs.map +0 -1
- package/dist/chunk-SMC5Q6ZH.mjs +0 -120
- package/dist/chunk-SMC5Q6ZH.mjs.map +0 -1
- package/dist/chunk-TIE3CPF7.js +0 -120
- package/dist/chunk-TIE3CPF7.js.map +0 -1
- package/dist/chunk-TJMQEH57.js +0 -66
- package/dist/chunk-TJMQEH57.js.map +0 -1
- package/dist/chunk-UGN7PBON.js +0 -176
- package/dist/chunk-UGN7PBON.js.map +0 -1
- package/dist/chunk-UHAFIPSL.js +0 -121
- package/dist/chunk-UHAFIPSL.js.map +0 -1
- package/dist/chunk-UHSRHP55.mjs +0 -106
- package/dist/chunk-UHSRHP55.mjs.map +0 -1
- package/dist/chunk-ULD4JC3Q.js +0 -399
- package/dist/chunk-ULD4JC3Q.js.map +0 -1
- package/dist/chunk-UQQWZT6C.mjs +0 -14
- package/dist/chunk-UQQWZT6C.mjs.map +0 -1
- package/dist/chunk-V72C4MCR.js +0 -137
- package/dist/chunk-V72C4MCR.js.map +0 -1
- package/dist/chunk-VEVVBHP3.mjs +0 -31
- package/dist/chunk-VEVVBHP3.mjs.map +0 -1
- package/dist/chunk-VGFPVAKX.mjs +0 -228
- package/dist/chunk-VGFPVAKX.mjs.map +0 -1
- package/dist/chunk-VKWOHNDO.js +0 -2509
- package/dist/chunk-VKWOHNDO.js.map +0 -1
- package/dist/chunk-WR5F34OW.js +0 -23
- package/dist/chunk-WR5F34OW.js.map +0 -1
- package/dist/chunk-X4XSEYPL.mjs +0 -201
- package/dist/chunk-X4XSEYPL.mjs.map +0 -1
- package/dist/chunk-XTMJ25EF.mjs +0 -2509
- package/dist/chunk-XTMJ25EF.mjs.map +0 -1
- package/dist/chunk-XUI43LEZ.mjs +0 -30
- package/dist/chunk-XUI43LEZ.mjs.map +0 -1
- package/dist/chunk-XVYXRCRL.js +0 -85
- package/dist/chunk-XVYXRCRL.js.map +0 -1
- package/dist/chunk-YVCX6Z75.js +0 -102
- package/dist/chunk-YVCX6Z75.js.map +0 -1
- package/dist/chunk-YWLMT7XH.js +0 -67
- package/dist/chunk-YWLMT7XH.js.map +0 -1
- package/dist/chunk-Z4BLTVTB.js +0 -30
- package/dist/chunk-Z4BLTVTB.js.map +0 -1
- package/dist/chunk-Z4GV3YQQ.mjs +0 -23
- package/dist/chunk-Z4GV3YQQ.mjs.map +0 -1
- package/dist/constants.js +0 -20
- package/dist/constants.js.map +0 -1
- package/dist/errors.js +0 -15
- package/dist/errors.js.map +0 -1
- package/dist/gas-flows/DefaultGasFeeFlow.js +0 -15
- package/dist/gas-flows/DefaultGasFeeFlow.js.map +0 -1
- package/dist/gas-flows/LineaGasFeeFlow.js +0 -16
- package/dist/gas-flows/LineaGasFeeFlow.js.map +0 -1
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.js +0 -11
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.js.map +0 -1
- package/dist/gas-flows/OracleLayer1GasFeeFlow.js +0 -9
- package/dist/gas-flows/OracleLayer1GasFeeFlow.js.map +0 -1
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.js +0 -11
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.js.map +0 -1
- package/dist/gas-flows/TestGasFeeFlow.js +0 -9
- package/dist/gas-flows/TestGasFeeFlow.js.map +0 -1
- package/dist/helpers/EtherscanRemoteTransactionSource.js +0 -12
- package/dist/helpers/EtherscanRemoteTransactionSource.js.map +0 -1
- package/dist/helpers/GasFeePoller.js +0 -12
- package/dist/helpers/GasFeePoller.js.map +0 -1
- package/dist/helpers/IncomingTransactionHelper.js +0 -9
- package/dist/helpers/IncomingTransactionHelper.js.map +0 -1
- package/dist/helpers/MultichainTrackingHelper.js +0 -13
- package/dist/helpers/MultichainTrackingHelper.js.map +0 -1
- package/dist/helpers/PendingTransactionTracker.js +0 -10
- package/dist/helpers/PendingTransactionTracker.js.map +0 -1
- package/dist/index.js +0 -77
- package/dist/index.js.map +0 -1
- package/dist/logger.js +0 -12
- package/dist/logger.js.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
- package/dist/types/TransactionController.d.ts.map +0 -1
- package/dist/types/constants.d.ts.map +0 -1
- package/dist/types/errors.d.ts.map +0 -1
- package/dist/types/gas-flows/DefaultGasFeeFlow.d.ts.map +0 -1
- package/dist/types/gas-flows/LineaGasFeeFlow.d.ts.map +0 -1
- package/dist/types/gas-flows/OptimismLayer1GasFeeFlow.d.ts.map +0 -1
- package/dist/types/gas-flows/OracleLayer1GasFeeFlow.d.ts.map +0 -1
- package/dist/types/gas-flows/ScrollLayer1GasFeeFlow.d.ts.map +0 -1
- package/dist/types/gas-flows/TestGasFeeFlow.d.ts.map +0 -1
- package/dist/types/helpers/EtherscanRemoteTransactionSource.d.ts.map +0 -1
- package/dist/types/helpers/GasFeePoller.d.ts.map +0 -1
- package/dist/types/helpers/IncomingTransactionHelper.d.ts.map +0 -1
- package/dist/types/helpers/MultichainTrackingHelper.d.ts.map +0 -1
- package/dist/types/helpers/PendingTransactionTracker.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/logger.d.ts.map +0 -1
- package/dist/types/types.d.ts.map +0 -1
- package/dist/types/utils/etherscan.d.ts.map +0 -1
- package/dist/types/utils/external-transactions.d.ts.map +0 -1
- package/dist/types/utils/gas-fees.d.ts.map +0 -1
- package/dist/types/utils/gas-flow.d.ts.map +0 -1
- package/dist/types/utils/gas.d.ts.map +0 -1
- package/dist/types/utils/history.d.ts.map +0 -1
- package/dist/types/utils/layer1-gas-fee-flow.d.ts.map +0 -1
- package/dist/types/utils/nonce.d.ts.map +0 -1
- package/dist/types/utils/retry.d.ts.map +0 -1
- package/dist/types/utils/simulation-api.d.ts.map +0 -1
- package/dist/types/utils/simulation.d.ts.map +0 -1
- package/dist/types/utils/swaps.d.ts.map +0 -1
- package/dist/types/utils/transaction-type.d.ts.map +0 -1
- package/dist/types/utils/utils.d.ts.map +0 -1
- package/dist/types/utils/validation.d.ts.map +0 -1
- package/dist/types.js +0 -24
- package/dist/types.js.map +0 -1
- package/dist/utils/etherscan.js +0 -14
- package/dist/utils/etherscan.js.map +0 -1
- package/dist/utils/external-transactions.js +0 -9
- package/dist/utils/external-transactions.js.map +0 -1
- package/dist/utils/gas-fees.js +0 -16
- package/dist/utils/gas-fees.js.map +0 -1
- package/dist/utils/gas-flow.js +0 -11
- package/dist/utils/gas-flow.js.map +0 -1
- package/dist/utils/gas.js +0 -20
- package/dist/utils/gas.js.map +0 -1
- package/dist/utils/history.js +0 -14
- package/dist/utils/history.js.map +0 -1
- package/dist/utils/layer1-gas-fee-flow.js +0 -11
- package/dist/utils/layer1-gas-fee-flow.js.map +0 -1
- package/dist/utils/nonce.js +0 -11
- package/dist/utils/nonce.js.map +0 -1
- package/dist/utils/retry.js +0 -8
- package/dist/utils/retry.js.map +0 -1
- package/dist/utils/simulation-api.js +0 -11
- package/dist/utils/simulation-api.js.map +0 -1
- package/dist/utils/simulation.js +0 -17
- package/dist/utils/simulation.js.map +0 -1
- package/dist/utils/swaps.js +0 -24
- package/dist/utils/swaps.js.map +0 -1
- package/dist/utils/transaction-type.js +0 -11
- package/dist/utils/transaction-type.js.map +0 -1
- package/dist/utils/utils.js +0 -23
- package/dist/utils/utils.js.map +0 -1
- package/dist/utils/validation.js +0 -12
- package/dist/utils/validation.js.map +0 -1
|
@@ -0,0 +1,828 @@
|
|
|
1
|
+
import { Hardfork } from "@ethereumjs/common";
|
|
2
|
+
import type { TypedTransaction } from "@ethereumjs/tx";
|
|
3
|
+
import type { AccountsControllerGetSelectedAccountAction } from "@metamask/accounts-controller";
|
|
4
|
+
import type { AddApprovalRequest } from "@metamask/approval-controller";
|
|
5
|
+
import type { ControllerGetStateAction, ControllerStateChangeEvent, RestrictedControllerMessenger } from "@metamask/base-controller";
|
|
6
|
+
import { BaseController } from "@metamask/base-controller";
|
|
7
|
+
import type { TraceCallback } from "@metamask/controller-utils";
|
|
8
|
+
import type { FetchGasFeeEstimateOptions, GasFeeState } from "@metamask/gas-fee-controller";
|
|
9
|
+
import type { BlockTracker, NetworkClientId, NetworkController, NetworkControllerStateChangeEvent, NetworkState, Provider, NetworkControllerFindNetworkClientIdByChainIdAction, NetworkControllerGetNetworkClientByIdAction } from "@metamask/network-controller";
|
|
10
|
+
import type { NonceLock, Transaction as NonceTrackerTransaction } from "@metamask/nonce-tracker";
|
|
11
|
+
import type { Hex } from "@metamask/utils";
|
|
12
|
+
import type { IncomingTransactionOptions } from "./helpers/IncomingTransactionHelper.mjs";
|
|
13
|
+
import type { SavedGasFees, SecurityProviderRequest, SendFlowHistoryEntry, TransactionParams, TransactionMeta, TransactionReceipt, WalletDevice, SecurityAlertResponse, GasFeeFlowResponse, GasPriceValue, FeeMarketEIP1559Values, SubmitHistoryEntry } from "./types.mjs";
|
|
14
|
+
import { TransactionType, TransactionStatus } from "./types.mjs";
|
|
15
|
+
export declare const HARDFORK = Hardfork.London;
|
|
16
|
+
/**
|
|
17
|
+
* Object with new transaction's meta and a promise resolving to the
|
|
18
|
+
* transaction hash if successful.
|
|
19
|
+
*
|
|
20
|
+
* @property result - Promise resolving to a new transaction hash
|
|
21
|
+
* @property transactionMeta - Meta information about this new transaction
|
|
22
|
+
*/
|
|
23
|
+
export interface Result {
|
|
24
|
+
result: Promise<string>;
|
|
25
|
+
transactionMeta: TransactionMeta;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Method data registry object
|
|
29
|
+
*
|
|
30
|
+
* @property registryMethod - Registry method raw string
|
|
31
|
+
* @property parsedRegistryMethod - Registry method object, containing name and method arguments
|
|
32
|
+
*/
|
|
33
|
+
export type MethodData = {
|
|
34
|
+
registryMethod: string;
|
|
35
|
+
parsedRegistryMethod: {
|
|
36
|
+
name: string;
|
|
37
|
+
args: {
|
|
38
|
+
type: string;
|
|
39
|
+
}[];
|
|
40
|
+
} | {
|
|
41
|
+
name?: any;
|
|
42
|
+
args?: any;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Transaction controller state
|
|
47
|
+
*
|
|
48
|
+
* @property transactions - A list of TransactionMeta objects
|
|
49
|
+
* @property methodData - Object containing all known method data information
|
|
50
|
+
* @property lastFetchedBlockNumbers - Last fetched block numbers.
|
|
51
|
+
*/
|
|
52
|
+
export type TransactionControllerState = {
|
|
53
|
+
transactions: TransactionMeta[];
|
|
54
|
+
methodData: Record<string, MethodData>;
|
|
55
|
+
lastFetchedBlockNumbers: {
|
|
56
|
+
[key: string]: number;
|
|
57
|
+
};
|
|
58
|
+
submitHistory: SubmitHistoryEntry[];
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Multiplier used to determine a transaction's increased gas fee during cancellation
|
|
62
|
+
*/
|
|
63
|
+
export declare const CANCEL_RATE = 1.1;
|
|
64
|
+
/**
|
|
65
|
+
* Multiplier used to determine a transaction's increased gas fee during speed up
|
|
66
|
+
*/
|
|
67
|
+
export declare const SPEED_UP_RATE = 1.1;
|
|
68
|
+
/**
|
|
69
|
+
* Represents the `TransactionController:getState` action.
|
|
70
|
+
*/
|
|
71
|
+
export type TransactionControllerGetStateAction = ControllerGetStateAction<typeof controllerName, TransactionControllerState>;
|
|
72
|
+
/**
|
|
73
|
+
* The internal actions available to the TransactionController.
|
|
74
|
+
*/
|
|
75
|
+
export type TransactionControllerActions = TransactionControllerGetStateAction;
|
|
76
|
+
/**
|
|
77
|
+
* Configuration options for the PendingTransactionTracker
|
|
78
|
+
*
|
|
79
|
+
* @property isResubmitEnabled - Whether transaction publishing is automatically retried.
|
|
80
|
+
*/
|
|
81
|
+
export type PendingTransactionOptions = {
|
|
82
|
+
isResubmitEnabled?: () => boolean;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* TransactionController constructor options.
|
|
86
|
+
*
|
|
87
|
+
* @property blockTracker - The block tracker used to poll for new blocks data.
|
|
88
|
+
* @property disableHistory - Whether to disable storing history in transaction metadata.
|
|
89
|
+
* @property disableSendFlowHistory - Explicitly disable transaction metadata history.
|
|
90
|
+
* @property disableSwaps - Whether to disable additional processing on swaps transactions.
|
|
91
|
+
* @property getCurrentAccountEIP1559Compatibility - Whether or not the account supports EIP-1559.
|
|
92
|
+
* @property getCurrentNetworkEIP1559Compatibility - Whether or not the network supports EIP-1559.
|
|
93
|
+
* @property getExternalPendingTransactions - Callback to retrieve pending transactions from external sources.
|
|
94
|
+
* @property getGasFeeEstimates - Callback to retrieve gas fee estimates.
|
|
95
|
+
* @property getNetworkClientRegistry - Gets the network client registry.
|
|
96
|
+
* @property getNetworkState - Gets the state of the network controller.
|
|
97
|
+
* @property getPermittedAccounts - Get accounts that a given origin has permissions for.
|
|
98
|
+
* @property getSavedGasFees - Gets the saved gas fee config.
|
|
99
|
+
* @property getSelectedAddress - Gets the address of the currently selected account.
|
|
100
|
+
* @property incomingTransactions - Configuration options for incoming transaction support.
|
|
101
|
+
* @property isMultichainEnabled - Enable multichain support.
|
|
102
|
+
* @property isSimulationEnabled - Whether new transactions will be automatically simulated.
|
|
103
|
+
* @property messenger - The controller messenger.
|
|
104
|
+
* @property onNetworkStateChange - Allows subscribing to network controller state changes.
|
|
105
|
+
* @property pendingTransactions - Configuration options for pending transaction support.
|
|
106
|
+
* @property provider - The provider used to create the underlying EthQuery instance.
|
|
107
|
+
* @property securityProviderRequest - A function for verifying a transaction, whether it is malicious or not.
|
|
108
|
+
* @property sign - Function used to sign transactions.
|
|
109
|
+
* @property state - Initial state to set on this controller.
|
|
110
|
+
* @property transactionHistoryLimit - Transaction history limit.
|
|
111
|
+
* @property hooks - The controller hooks.
|
|
112
|
+
* @property hooks.afterSign - Additional logic to execute after signing a transaction. Return false to not change the status to signed.
|
|
113
|
+
* @property hooks.beforeApproveOnInit - Additional logic to execute before starting an approval flow for a transaction during initialization. Return false to skip the transaction.
|
|
114
|
+
* @property hooks.beforeCheckPendingTransaction - Additional logic to execute before checking pending transactions. Return false to prevent the broadcast of the transaction.
|
|
115
|
+
* @property hooks.beforePublish - Additional logic to execute before publishing a transaction. Return false to prevent the broadcast of the transaction.
|
|
116
|
+
* @property hooks.getAdditionalSignArguments - Returns additional arguments required to sign a transaction.
|
|
117
|
+
* @property hooks.publish - Alternate logic to publish a transaction.
|
|
118
|
+
*/
|
|
119
|
+
export type TransactionControllerOptions = {
|
|
120
|
+
blockTracker: BlockTracker;
|
|
121
|
+
disableHistory: boolean;
|
|
122
|
+
disableSendFlowHistory: boolean;
|
|
123
|
+
disableSwaps: boolean;
|
|
124
|
+
getCurrentAccountEIP1559Compatibility?: () => Promise<boolean>;
|
|
125
|
+
getCurrentNetworkEIP1559Compatibility: () => Promise<boolean>;
|
|
126
|
+
getExternalPendingTransactions?: (address: string, chainId?: string) => NonceTrackerTransaction[];
|
|
127
|
+
getGasFeeEstimates?: (options: FetchGasFeeEstimateOptions) => Promise<GasFeeState>;
|
|
128
|
+
getNetworkClientRegistry: NetworkController['getNetworkClientRegistry'];
|
|
129
|
+
getNetworkState: () => NetworkState;
|
|
130
|
+
getPermittedAccounts?: (origin?: string) => Promise<string[]>;
|
|
131
|
+
getSavedGasFees?: (chainId: Hex) => SavedGasFees | undefined;
|
|
132
|
+
incomingTransactions?: IncomingTransactionOptions;
|
|
133
|
+
isMultichainEnabled: boolean;
|
|
134
|
+
isSimulationEnabled?: () => boolean;
|
|
135
|
+
messenger: TransactionControllerMessenger;
|
|
136
|
+
onNetworkStateChange: (listener: (state: NetworkState) => void) => void;
|
|
137
|
+
pendingTransactions?: PendingTransactionOptions;
|
|
138
|
+
provider: Provider;
|
|
139
|
+
securityProviderRequest?: SecurityProviderRequest;
|
|
140
|
+
sign?: (transaction: TypedTransaction, from: string, transactionMeta?: TransactionMeta) => Promise<TypedTransaction>;
|
|
141
|
+
state?: Partial<TransactionControllerState>;
|
|
142
|
+
testGasFeeFlows?: boolean;
|
|
143
|
+
trace?: TraceCallback;
|
|
144
|
+
transactionHistoryLimit: number;
|
|
145
|
+
hooks: {
|
|
146
|
+
afterSign?: (transactionMeta: TransactionMeta, signedTx: TypedTransaction) => boolean;
|
|
147
|
+
beforeCheckPendingTransaction?: (transactionMeta: TransactionMeta) => boolean;
|
|
148
|
+
beforePublish?: (transactionMeta: TransactionMeta) => boolean;
|
|
149
|
+
getAdditionalSignArguments?: (transactionMeta: TransactionMeta) => (TransactionMeta | undefined)[];
|
|
150
|
+
publish?: (transactionMeta: TransactionMeta) => Promise<{
|
|
151
|
+
transactionHash: string;
|
|
152
|
+
}>;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* The name of the {@link TransactionController}.
|
|
157
|
+
*/
|
|
158
|
+
declare const controllerName = "TransactionController";
|
|
159
|
+
/**
|
|
160
|
+
* The external actions available to the {@link TransactionController}.
|
|
161
|
+
*/
|
|
162
|
+
export type AllowedActions = AddApprovalRequest | NetworkControllerFindNetworkClientIdByChainIdAction | NetworkControllerGetNetworkClientByIdAction | AccountsControllerGetSelectedAccountAction;
|
|
163
|
+
/**
|
|
164
|
+
* The external events available to the {@link TransactionController}.
|
|
165
|
+
*/
|
|
166
|
+
export type AllowedEvents = NetworkControllerStateChangeEvent;
|
|
167
|
+
/**
|
|
168
|
+
* Represents the `TransactionController:stateChange` event.
|
|
169
|
+
*/
|
|
170
|
+
export type TransactionControllerStateChangeEvent = ControllerStateChangeEvent<typeof controllerName, TransactionControllerState>;
|
|
171
|
+
/**
|
|
172
|
+
* Represents the `TransactionController:incomingTransactionBlockReceived` event.
|
|
173
|
+
*/
|
|
174
|
+
export type TransactionControllerIncomingTransactionBlockReceivedEvent = {
|
|
175
|
+
type: `${typeof controllerName}:incomingTransactionBlockReceived`;
|
|
176
|
+
payload: [blockNumber: number];
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Represents the `TransactionController:postTransactionBalanceUpdated` event.
|
|
180
|
+
*/
|
|
181
|
+
export type TransactionControllerPostTransactionBalanceUpdatedEvent = {
|
|
182
|
+
type: `${typeof controllerName}:postTransactionBalanceUpdated`;
|
|
183
|
+
payload: [
|
|
184
|
+
{
|
|
185
|
+
transactionMeta: TransactionMeta;
|
|
186
|
+
approvalTransactionMeta?: TransactionMeta;
|
|
187
|
+
}
|
|
188
|
+
];
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Represents the `TransactionController:speedUpTransactionAdded` event.
|
|
192
|
+
*/
|
|
193
|
+
export type TransactionControllerSpeedupTransactionAddedEvent = {
|
|
194
|
+
type: `${typeof controllerName}:speedupTransactionAdded`;
|
|
195
|
+
payload: [transactionMeta: TransactionMeta];
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* Represents the `TransactionController:transactionApproved` event.
|
|
199
|
+
*/
|
|
200
|
+
export type TransactionControllerTransactionApprovedEvent = {
|
|
201
|
+
type: `${typeof controllerName}:transactionApproved`;
|
|
202
|
+
payload: [
|
|
203
|
+
{
|
|
204
|
+
transactionMeta: TransactionMeta;
|
|
205
|
+
actionId?: string;
|
|
206
|
+
}
|
|
207
|
+
];
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* Represents the `TransactionController:transactionConfirmed` event.
|
|
211
|
+
*/
|
|
212
|
+
export type TransactionControllerTransactionConfirmedEvent = {
|
|
213
|
+
type: `${typeof controllerName}:transactionConfirmed`;
|
|
214
|
+
payload: [transactionMeta: TransactionMeta];
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* Represents the `TransactionController:transactionDropped` event.
|
|
218
|
+
*/
|
|
219
|
+
export type TransactionControllerTransactionDroppedEvent = {
|
|
220
|
+
type: `${typeof controllerName}:transactionDropped`;
|
|
221
|
+
payload: [{
|
|
222
|
+
transactionMeta: TransactionMeta;
|
|
223
|
+
}];
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* Represents the `TransactionController:transactionFailed` event.
|
|
227
|
+
*/
|
|
228
|
+
export type TransactionControllerTransactionFailedEvent = {
|
|
229
|
+
type: `${typeof controllerName}:transactionFailed`;
|
|
230
|
+
payload: [
|
|
231
|
+
{
|
|
232
|
+
actionId?: string;
|
|
233
|
+
error: string;
|
|
234
|
+
transactionMeta: TransactionMeta;
|
|
235
|
+
}
|
|
236
|
+
];
|
|
237
|
+
};
|
|
238
|
+
/**
|
|
239
|
+
* Represents the `TransactionController:transactionFinished` event.
|
|
240
|
+
*/
|
|
241
|
+
export type TransactionControllerTransactionFinishedEvent = {
|
|
242
|
+
type: `${typeof controllerName}:transactionFinished`;
|
|
243
|
+
payload: [transactionMeta: TransactionMeta];
|
|
244
|
+
};
|
|
245
|
+
/**
|
|
246
|
+
* Represents the `TransactionController:transactionNewSwapApproval` event.
|
|
247
|
+
*/
|
|
248
|
+
export type TransactionControllerTransactionNewSwapApprovalEvent = {
|
|
249
|
+
type: `${typeof controllerName}:transactionNewSwapApproval`;
|
|
250
|
+
payload: [{
|
|
251
|
+
transactionMeta: TransactionMeta;
|
|
252
|
+
}];
|
|
253
|
+
};
|
|
254
|
+
/**
|
|
255
|
+
* Represents the `TransactionController:transactionNewSwap` event.
|
|
256
|
+
*/
|
|
257
|
+
export type TransactionControllerTransactionNewSwapEvent = {
|
|
258
|
+
type: `${typeof controllerName}:transactionNewSwap`;
|
|
259
|
+
payload: [{
|
|
260
|
+
transactionMeta: TransactionMeta;
|
|
261
|
+
}];
|
|
262
|
+
};
|
|
263
|
+
/**
|
|
264
|
+
* Represents the `TransactionController:transactionNewSwapApproval` event.
|
|
265
|
+
*/
|
|
266
|
+
export type TransactionControllerTransactionNewSwapAndSendEvent = {
|
|
267
|
+
type: `${typeof controllerName}:transactionNewSwapAndSend`;
|
|
268
|
+
payload: [{
|
|
269
|
+
transactionMeta: TransactionMeta;
|
|
270
|
+
}];
|
|
271
|
+
};
|
|
272
|
+
/**
|
|
273
|
+
* Represents the `TransactionController:transactionPublishingSkipped` event.
|
|
274
|
+
*/
|
|
275
|
+
export type TransactionControllerTransactionPublishingSkipped = {
|
|
276
|
+
type: `${typeof controllerName}:transactionPublishingSkipped`;
|
|
277
|
+
payload: [transactionMeta: TransactionMeta];
|
|
278
|
+
};
|
|
279
|
+
/**
|
|
280
|
+
* Represents the `TransactionController:transactionRejected` event.
|
|
281
|
+
*/
|
|
282
|
+
export type TransactionControllerTransactionRejectedEvent = {
|
|
283
|
+
type: `${typeof controllerName}:transactionRejected`;
|
|
284
|
+
payload: [
|
|
285
|
+
{
|
|
286
|
+
transactionMeta: TransactionMeta;
|
|
287
|
+
actionId?: string;
|
|
288
|
+
}
|
|
289
|
+
];
|
|
290
|
+
};
|
|
291
|
+
/**
|
|
292
|
+
* Represents the `TransactionController:transactionStatusUpdated` event.
|
|
293
|
+
*/
|
|
294
|
+
export type TransactionControllerTransactionStatusUpdatedEvent = {
|
|
295
|
+
type: `${typeof controllerName}:transactionStatusUpdated`;
|
|
296
|
+
payload: [
|
|
297
|
+
{
|
|
298
|
+
transactionMeta: TransactionMeta;
|
|
299
|
+
}
|
|
300
|
+
];
|
|
301
|
+
};
|
|
302
|
+
/**
|
|
303
|
+
* Represents the `TransactionController:transactionSubmitted` event.
|
|
304
|
+
*/
|
|
305
|
+
export type TransactionControllerTransactionSubmittedEvent = {
|
|
306
|
+
type: `${typeof controllerName}:transactionSubmitted`;
|
|
307
|
+
payload: [
|
|
308
|
+
{
|
|
309
|
+
transactionMeta: TransactionMeta;
|
|
310
|
+
actionId?: string;
|
|
311
|
+
}
|
|
312
|
+
];
|
|
313
|
+
};
|
|
314
|
+
/**
|
|
315
|
+
* Represents the `TransactionController:unapprovedTransactionAdded` event.
|
|
316
|
+
*/
|
|
317
|
+
export type TransactionControllerUnapprovedTransactionAddedEvent = {
|
|
318
|
+
type: `${typeof controllerName}:unapprovedTransactionAdded`;
|
|
319
|
+
payload: [transactionMeta: TransactionMeta];
|
|
320
|
+
};
|
|
321
|
+
/**
|
|
322
|
+
* The internal events available to the {@link TransactionController}.
|
|
323
|
+
*/
|
|
324
|
+
export type TransactionControllerEvents = TransactionControllerIncomingTransactionBlockReceivedEvent | TransactionControllerPostTransactionBalanceUpdatedEvent | TransactionControllerSpeedupTransactionAddedEvent | TransactionControllerStateChangeEvent | TransactionControllerTransactionApprovedEvent | TransactionControllerTransactionConfirmedEvent | TransactionControllerTransactionDroppedEvent | TransactionControllerTransactionFailedEvent | TransactionControllerTransactionFinishedEvent | TransactionControllerTransactionNewSwapApprovalEvent | TransactionControllerTransactionNewSwapEvent | TransactionControllerTransactionNewSwapAndSendEvent | TransactionControllerTransactionPublishingSkipped | TransactionControllerTransactionRejectedEvent | TransactionControllerTransactionStatusUpdatedEvent | TransactionControllerTransactionSubmittedEvent | TransactionControllerUnapprovedTransactionAddedEvent;
|
|
325
|
+
/**
|
|
326
|
+
* The messenger of the {@link TransactionController}.
|
|
327
|
+
*/
|
|
328
|
+
export type TransactionControllerMessenger = RestrictedControllerMessenger<typeof controllerName, TransactionControllerActions | AllowedActions, TransactionControllerEvents | AllowedEvents, AllowedActions['type'], AllowedEvents['type']>;
|
|
329
|
+
/**
|
|
330
|
+
* Possible states of the approve transaction step.
|
|
331
|
+
*/
|
|
332
|
+
export declare enum ApprovalState {
|
|
333
|
+
Approved = "approved",
|
|
334
|
+
NotApproved = "not-approved",
|
|
335
|
+
SkippedViaBeforePublishHook = "skipped-via-before-publish-hook"
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Controller responsible for submitting and managing transactions.
|
|
339
|
+
*/
|
|
340
|
+
export declare class TransactionController extends BaseController<typeof controllerName, TransactionControllerState, TransactionControllerMessenger> {
|
|
341
|
+
#private;
|
|
342
|
+
private readonly isHistoryDisabled;
|
|
343
|
+
private readonly isSwapsDisabled;
|
|
344
|
+
private readonly isSendFlowHistoryDisabled;
|
|
345
|
+
private readonly approvingTransactionIds;
|
|
346
|
+
private readonly nonceTracker;
|
|
347
|
+
private readonly registry;
|
|
348
|
+
private readonly mutex;
|
|
349
|
+
private readonly gasFeeFlows;
|
|
350
|
+
private readonly getSavedGasFees;
|
|
351
|
+
private readonly getNetworkState;
|
|
352
|
+
private readonly getCurrentAccountEIP1559Compatibility;
|
|
353
|
+
private readonly getCurrentNetworkEIP1559Compatibility;
|
|
354
|
+
private readonly getGasFeeEstimates;
|
|
355
|
+
private readonly getPermittedAccounts?;
|
|
356
|
+
private readonly getExternalPendingTransactions;
|
|
357
|
+
private readonly layer1GasFeeFlows;
|
|
358
|
+
private readonly incomingTransactionHelper;
|
|
359
|
+
private readonly securityProviderRequest?;
|
|
360
|
+
private readonly pendingTransactionTracker;
|
|
361
|
+
private readonly signAbortCallbacks;
|
|
362
|
+
private readonly afterSign;
|
|
363
|
+
private readonly beforeCheckPendingTransaction;
|
|
364
|
+
private readonly beforePublish;
|
|
365
|
+
private readonly publish;
|
|
366
|
+
private readonly getAdditionalSignArguments;
|
|
367
|
+
private failTransaction;
|
|
368
|
+
private registryLookup;
|
|
369
|
+
/**
|
|
370
|
+
* Method used to sign transactions
|
|
371
|
+
*/
|
|
372
|
+
sign?: (transaction: TypedTransaction, from: string, transactionMeta?: TransactionMeta) => Promise<TypedTransaction>;
|
|
373
|
+
/**
|
|
374
|
+
* Constructs a TransactionController.
|
|
375
|
+
*
|
|
376
|
+
* @param options - The controller options.
|
|
377
|
+
* @param options.blockTracker - The block tracker used to poll for new blocks data.
|
|
378
|
+
* @param options.disableHistory - Whether to disable storing history in transaction metadata.
|
|
379
|
+
* @param options.disableSendFlowHistory - Explicitly disable transaction metadata history.
|
|
380
|
+
* @param options.disableSwaps - Whether to disable additional processing on swaps transactions.
|
|
381
|
+
* @param options.getCurrentAccountEIP1559Compatibility - Whether or not the account supports EIP-1559.
|
|
382
|
+
* @param options.getCurrentNetworkEIP1559Compatibility - Whether or not the network supports EIP-1559.
|
|
383
|
+
* @param options.getExternalPendingTransactions - Callback to retrieve pending transactions from external sources.
|
|
384
|
+
* @param options.getGasFeeEstimates - Callback to retrieve gas fee estimates.
|
|
385
|
+
* @param options.getNetworkClientRegistry - Gets the network client registry.
|
|
386
|
+
* @param options.getNetworkState - Gets the state of the network controller.
|
|
387
|
+
* @param options.getPermittedAccounts - Get accounts that a given origin has permissions for.
|
|
388
|
+
* @param options.getSavedGasFees - Gets the saved gas fee config.
|
|
389
|
+
* @param options.incomingTransactions - Configuration options for incoming transaction support.
|
|
390
|
+
* @param options.isMultichainEnabled - Enable multichain support.
|
|
391
|
+
* @param options.isSimulationEnabled - Whether new transactions will be automatically simulated.
|
|
392
|
+
* @param options.messenger - The controller messenger.
|
|
393
|
+
* @param options.onNetworkStateChange - Allows subscribing to network controller state changes.
|
|
394
|
+
* @param options.pendingTransactions - Configuration options for pending transaction support.
|
|
395
|
+
* @param options.provider - The provider used to create the underlying EthQuery instance.
|
|
396
|
+
* @param options.securityProviderRequest - A function for verifying a transaction, whether it is malicious or not.
|
|
397
|
+
* @param options.sign - Function used to sign transactions.
|
|
398
|
+
* @param options.state - Initial state to set on this controller.
|
|
399
|
+
* @param options.testGasFeeFlows - Whether to use the test gas fee flow.
|
|
400
|
+
* @param options.trace - Callback to generate trace information.
|
|
401
|
+
* @param options.transactionHistoryLimit - Transaction history limit.
|
|
402
|
+
* @param options.hooks - The controller hooks.
|
|
403
|
+
*/
|
|
404
|
+
constructor({ blockTracker, disableHistory, disableSendFlowHistory, disableSwaps, getCurrentAccountEIP1559Compatibility, getCurrentNetworkEIP1559Compatibility, getExternalPendingTransactions, getGasFeeEstimates, getNetworkClientRegistry, getNetworkState, getPermittedAccounts, getSavedGasFees, incomingTransactions, isMultichainEnabled, isSimulationEnabled, messenger, onNetworkStateChange, pendingTransactions, provider, securityProviderRequest, sign, state, testGasFeeFlows, trace, transactionHistoryLimit, hooks, }: TransactionControllerOptions);
|
|
405
|
+
/**
|
|
406
|
+
* Stops polling and removes listeners to prepare the controller for garbage collection.
|
|
407
|
+
*/
|
|
408
|
+
destroy(): void;
|
|
409
|
+
/**
|
|
410
|
+
* Handle new method data request.
|
|
411
|
+
*
|
|
412
|
+
* @param fourBytePrefix - The method prefix.
|
|
413
|
+
* @returns The method data object corresponding to the given signature prefix.
|
|
414
|
+
*/
|
|
415
|
+
handleMethodData(fourBytePrefix: string): Promise<MethodData>;
|
|
416
|
+
/**
|
|
417
|
+
* Add a new unapproved transaction to state. Parameters will be validated, a
|
|
418
|
+
* unique transaction id will be generated, and gas and gasPrice will be calculated
|
|
419
|
+
* if not provided. If A `<tx.id>:unapproved` hub event will be emitted once added.
|
|
420
|
+
*
|
|
421
|
+
* @param txParams - Standard parameters for an Ethereum transaction.
|
|
422
|
+
* @param opts - Additional options to control how the transaction is added.
|
|
423
|
+
* @param opts.actionId - Unique ID to prevent duplicate requests.
|
|
424
|
+
* @param opts.deviceConfirmedOn - An enum to indicate what device confirmed the transaction.
|
|
425
|
+
* @param opts.method - RPC method that requested the transaction.
|
|
426
|
+
* @param opts.origin - The origin of the transaction request, such as a dApp hostname.
|
|
427
|
+
* @param opts.requireApproval - Whether the transaction requires approval by the user, defaults to true unless explicitly disabled.
|
|
428
|
+
* @param opts.securityAlertResponse - Response from security validator.
|
|
429
|
+
* @param opts.sendFlowHistory - The sendFlowHistory entries to add.
|
|
430
|
+
* @param opts.type - Type of transaction to add, such as 'cancel' or 'swap'.
|
|
431
|
+
* @param opts.swaps - Options for swaps transactions.
|
|
432
|
+
* @param opts.swaps.hasApproveTx - Whether the transaction has an approval transaction.
|
|
433
|
+
* @param opts.swaps.meta - Metadata for swap transaction.
|
|
434
|
+
* @param opts.networkClientId - The id of the network client for this transaction.
|
|
435
|
+
* @param opts.traceContext - The parent context for any new traces.
|
|
436
|
+
* @returns Object containing a promise resolving to the transaction hash if approved.
|
|
437
|
+
*/
|
|
438
|
+
addTransaction(txParams: TransactionParams, { actionId, deviceConfirmedOn, method, origin, requireApproval, securityAlertResponse, sendFlowHistory, swaps, traceContext, type, networkClientId: requestNetworkClientId, }?: {
|
|
439
|
+
actionId?: string;
|
|
440
|
+
deviceConfirmedOn?: WalletDevice;
|
|
441
|
+
method?: string;
|
|
442
|
+
origin?: string;
|
|
443
|
+
requireApproval?: boolean | undefined;
|
|
444
|
+
securityAlertResponse?: SecurityAlertResponse;
|
|
445
|
+
sendFlowHistory?: SendFlowHistoryEntry[];
|
|
446
|
+
swaps?: {
|
|
447
|
+
hasApproveTx?: boolean;
|
|
448
|
+
meta?: Partial<TransactionMeta>;
|
|
449
|
+
};
|
|
450
|
+
traceContext?: unknown;
|
|
451
|
+
type?: TransactionType;
|
|
452
|
+
networkClientId?: NetworkClientId;
|
|
453
|
+
}): Promise<Result>;
|
|
454
|
+
startIncomingTransactionPolling(networkClientIds?: NetworkClientId[]): void;
|
|
455
|
+
stopIncomingTransactionPolling(networkClientIds?: NetworkClientId[]): void;
|
|
456
|
+
stopAllIncomingTransactionPolling(): void;
|
|
457
|
+
updateIncomingTransactions(networkClientIds?: NetworkClientId[]): Promise<void>;
|
|
458
|
+
/**
|
|
459
|
+
* Attempts to cancel a transaction based on its ID by setting its status to "rejected"
|
|
460
|
+
* and emitting a `<tx.id>:finished` hub event.
|
|
461
|
+
*
|
|
462
|
+
* @param transactionId - The ID of the transaction to cancel.
|
|
463
|
+
* @param gasValues - The gas values to use for the cancellation transaction.
|
|
464
|
+
* @param options - The options for the cancellation transaction.
|
|
465
|
+
* @param options.actionId - Unique ID to prevent duplicate requests.
|
|
466
|
+
* @param options.estimatedBaseFee - The estimated base fee of the transaction.
|
|
467
|
+
*/
|
|
468
|
+
stopTransaction(transactionId: string, gasValues?: GasPriceValue | FeeMarketEIP1559Values, { estimatedBaseFee, actionId, }?: {
|
|
469
|
+
estimatedBaseFee?: string;
|
|
470
|
+
actionId?: string;
|
|
471
|
+
}): Promise<void>;
|
|
472
|
+
/**
|
|
473
|
+
* Attempts to speed up a transaction increasing transaction gasPrice by ten percent.
|
|
474
|
+
*
|
|
475
|
+
* @param transactionId - The ID of the transaction to speed up.
|
|
476
|
+
* @param gasValues - The gas values to use for the speed up transaction.
|
|
477
|
+
* @param options - The options for the speed up transaction.
|
|
478
|
+
* @param options.actionId - Unique ID to prevent duplicate requests
|
|
479
|
+
* @param options.estimatedBaseFee - The estimated base fee of the transaction.
|
|
480
|
+
*/
|
|
481
|
+
speedUpTransaction(transactionId: string, gasValues?: GasPriceValue | FeeMarketEIP1559Values, { actionId, estimatedBaseFee, }?: {
|
|
482
|
+
actionId?: string;
|
|
483
|
+
estimatedBaseFee?: string;
|
|
484
|
+
}): Promise<void>;
|
|
485
|
+
/**
|
|
486
|
+
* Estimates required gas for a given transaction.
|
|
487
|
+
*
|
|
488
|
+
* @param transaction - The transaction to estimate gas for.
|
|
489
|
+
* @param networkClientId - The network client id to use for the estimate.
|
|
490
|
+
* @returns The gas and gas price.
|
|
491
|
+
*/
|
|
492
|
+
estimateGas(transaction: TransactionParams, networkClientId?: NetworkClientId): Promise<{
|
|
493
|
+
gas: string;
|
|
494
|
+
simulationFails: {
|
|
495
|
+
reason: any;
|
|
496
|
+
errorKey: any;
|
|
497
|
+
debug: {
|
|
498
|
+
blockNumber: string;
|
|
499
|
+
blockGasLimit: string;
|
|
500
|
+
};
|
|
501
|
+
} | undefined;
|
|
502
|
+
}>;
|
|
503
|
+
/**
|
|
504
|
+
* Estimates required gas for a given transaction and add additional gas buffer with the given multiplier.
|
|
505
|
+
*
|
|
506
|
+
* @param transaction - The transaction params to estimate gas for.
|
|
507
|
+
* @param multiplier - The multiplier to use for the gas buffer.
|
|
508
|
+
* @param networkClientId - The network client id to use for the estimate.
|
|
509
|
+
*/
|
|
510
|
+
estimateGasBuffered(transaction: TransactionParams, multiplier: number, networkClientId?: NetworkClientId): Promise<{
|
|
511
|
+
gas: `0x${string}`;
|
|
512
|
+
simulationFails: {
|
|
513
|
+
reason: any;
|
|
514
|
+
errorKey: any;
|
|
515
|
+
debug: {
|
|
516
|
+
blockNumber: string;
|
|
517
|
+
blockGasLimit: string;
|
|
518
|
+
};
|
|
519
|
+
} | undefined;
|
|
520
|
+
}>;
|
|
521
|
+
/**
|
|
522
|
+
* Updates an existing transaction in state.
|
|
523
|
+
*
|
|
524
|
+
* @param transactionMeta - The new transaction to store in state.
|
|
525
|
+
* @param note - A note or update reason to include in the transaction history.
|
|
526
|
+
*/
|
|
527
|
+
updateTransaction(transactionMeta: TransactionMeta, note: string): void;
|
|
528
|
+
/**
|
|
529
|
+
* Update the security alert response for a transaction.
|
|
530
|
+
*
|
|
531
|
+
* @param transactionId - ID of the transaction.
|
|
532
|
+
* @param securityAlertResponse - The new security alert response for the transaction.
|
|
533
|
+
*/
|
|
534
|
+
updateSecurityAlertResponse(transactionId: string, securityAlertResponse: SecurityAlertResponse): void;
|
|
535
|
+
/**
|
|
536
|
+
* Removes all transactions from state, optionally based on the current network.
|
|
537
|
+
*
|
|
538
|
+
* @param ignoreNetwork - Determines whether to wipe all transactions, or just those on the
|
|
539
|
+
* current network. If `true`, all transactions are wiped.
|
|
540
|
+
* @param address - If specified, only transactions originating from this address will be
|
|
541
|
+
* wiped on current network.
|
|
542
|
+
*/
|
|
543
|
+
wipeTransactions(ignoreNetwork?: boolean, address?: string): void;
|
|
544
|
+
/**
|
|
545
|
+
* Adds external provided transaction to state as confirmed transaction.
|
|
546
|
+
*
|
|
547
|
+
* @param transactionMeta - TransactionMeta to add transactions.
|
|
548
|
+
* @param transactionReceipt - TransactionReceipt of the external transaction.
|
|
549
|
+
* @param baseFeePerGas - Base fee per gas of the external transaction.
|
|
550
|
+
*/
|
|
551
|
+
confirmExternalTransaction(transactionMeta: TransactionMeta, transactionReceipt: TransactionReceipt, baseFeePerGas: Hex): Promise<void>;
|
|
552
|
+
/**
|
|
553
|
+
* Append new send flow history to a transaction.
|
|
554
|
+
*
|
|
555
|
+
* @param transactionID - The ID of the transaction to update.
|
|
556
|
+
* @param currentSendFlowHistoryLength - The length of the current sendFlowHistory array.
|
|
557
|
+
* @param sendFlowHistoryToAdd - The sendFlowHistory entries to add.
|
|
558
|
+
* @returns The updated transactionMeta.
|
|
559
|
+
*/
|
|
560
|
+
updateTransactionSendFlowHistory(transactionID: string, currentSendFlowHistoryLength: number, sendFlowHistoryToAdd: SendFlowHistoryEntry[]): TransactionMeta;
|
|
561
|
+
/**
|
|
562
|
+
* Update the gas values of a transaction.
|
|
563
|
+
*
|
|
564
|
+
* @param transactionId - The ID of the transaction to update.
|
|
565
|
+
* @param gasValues - Gas values to update.
|
|
566
|
+
* @param gasValues.gas - Same as transaction.gasLimit.
|
|
567
|
+
* @param gasValues.gasLimit - Maxmimum number of units of gas to use for this transaction.
|
|
568
|
+
* @param gasValues.gasPrice - Price per gas for legacy transactions.
|
|
569
|
+
* @param gasValues.maxPriorityFeePerGas - Maximum amount per gas to give to validator as incentive.
|
|
570
|
+
* @param gasValues.maxFeePerGas - Maximum amount per gas to pay for the transaction, including the priority fee.
|
|
571
|
+
* @param gasValues.estimateUsed - Which estimate level was used.
|
|
572
|
+
* @param gasValues.estimateSuggested - Which estimate level that the API suggested.
|
|
573
|
+
* @param gasValues.defaultGasEstimates - The default estimate for gas.
|
|
574
|
+
* @param gasValues.originalGasEstimate - Original estimate for gas.
|
|
575
|
+
* @param gasValues.userEditedGasLimit - The gas limit supplied by user.
|
|
576
|
+
* @param gasValues.userFeeLevel - Estimate level user selected.
|
|
577
|
+
* @returns The updated transactionMeta.
|
|
578
|
+
*/
|
|
579
|
+
updateTransactionGasFees(transactionId: string, { defaultGasEstimates, estimateUsed, estimateSuggested, gas, gasLimit, gasPrice, maxPriorityFeePerGas, maxFeePerGas, originalGasEstimate, userEditedGasLimit, userFeeLevel, }: {
|
|
580
|
+
defaultGasEstimates?: string;
|
|
581
|
+
estimateUsed?: string;
|
|
582
|
+
estimateSuggested?: string;
|
|
583
|
+
gas?: string;
|
|
584
|
+
gasLimit?: string;
|
|
585
|
+
gasPrice?: string;
|
|
586
|
+
maxPriorityFeePerGas?: string;
|
|
587
|
+
maxFeePerGas?: string;
|
|
588
|
+
originalGasEstimate?: string;
|
|
589
|
+
userEditedGasLimit?: boolean;
|
|
590
|
+
userFeeLevel?: string;
|
|
591
|
+
}): TransactionMeta;
|
|
592
|
+
/**
|
|
593
|
+
* Update the previous gas values of a transaction.
|
|
594
|
+
*
|
|
595
|
+
* @param transactionId - The ID of the transaction to update.
|
|
596
|
+
* @param previousGas - Previous gas values to update.
|
|
597
|
+
* @param previousGas.gasLimit - Maxmimum number of units of gas to use for this transaction.
|
|
598
|
+
* @param previousGas.maxFeePerGas - Maximum amount per gas to pay for the transaction, including the priority fee.
|
|
599
|
+
* @param previousGas.maxPriorityFeePerGas - Maximum amount per gas to give to validator as incentive.
|
|
600
|
+
* @returns The updated transactionMeta.
|
|
601
|
+
*/
|
|
602
|
+
updatePreviousGasParams(transactionId: string, { gasLimit, maxFeePerGas, maxPriorityFeePerGas, }: {
|
|
603
|
+
gasLimit?: string;
|
|
604
|
+
maxFeePerGas?: string;
|
|
605
|
+
maxPriorityFeePerGas?: string;
|
|
606
|
+
}): TransactionMeta;
|
|
607
|
+
getNonceLock(address: string, networkClientId?: NetworkClientId): Promise<NonceLock>;
|
|
608
|
+
/**
|
|
609
|
+
* Updates the editable parameters of a transaction.
|
|
610
|
+
*
|
|
611
|
+
* @param txId - The ID of the transaction to update.
|
|
612
|
+
* @param params - The editable parameters to update.
|
|
613
|
+
* @param params.data - Data to pass with the transaction.
|
|
614
|
+
* @param params.gas - Maximum number of units of gas to use for the transaction.
|
|
615
|
+
* @param params.gasPrice - Price per gas for legacy transactions.
|
|
616
|
+
* @param params.from - Address to send the transaction from.
|
|
617
|
+
* @param params.to - Address to send the transaction to.
|
|
618
|
+
* @param params.value - Value associated with the transaction.
|
|
619
|
+
* @returns The updated transaction metadata.
|
|
620
|
+
*/
|
|
621
|
+
updateEditableParams(txId: string, { data, gas, gasPrice, from, to, value, }: {
|
|
622
|
+
data?: string;
|
|
623
|
+
gas?: string;
|
|
624
|
+
gasPrice?: string;
|
|
625
|
+
from?: string;
|
|
626
|
+
to?: string;
|
|
627
|
+
value?: string;
|
|
628
|
+
}): Promise<Readonly<TransactionMeta> | undefined>;
|
|
629
|
+
/**
|
|
630
|
+
* Signs and returns the raw transaction data for provided transaction params list.
|
|
631
|
+
*
|
|
632
|
+
* @param listOfTxParams - The list of transaction params to approve.
|
|
633
|
+
* @param opts - Options bag.
|
|
634
|
+
* @param opts.hasNonce - Whether the transactions already have a nonce.
|
|
635
|
+
* @returns The raw transactions.
|
|
636
|
+
*/
|
|
637
|
+
approveTransactionsWithSameNonce(listOfTxParams?: (TransactionParams & {
|
|
638
|
+
chainId: Hex;
|
|
639
|
+
})[], { hasNonce }?: {
|
|
640
|
+
hasNonce?: boolean;
|
|
641
|
+
}): Promise<string | string[]>;
|
|
642
|
+
/**
|
|
643
|
+
* Update a custodial transaction.
|
|
644
|
+
*
|
|
645
|
+
* @param transactionId - The ID of the transaction to update.
|
|
646
|
+
* @param options - The custodial transaction options to update.
|
|
647
|
+
* @param options.errorMessage - The error message to be assigned in case transaction status update to failed.
|
|
648
|
+
* @param options.hash - The new hash value to be assigned.
|
|
649
|
+
* @param options.status - The new status value to be assigned.
|
|
650
|
+
*/
|
|
651
|
+
updateCustodialTransaction(transactionId: string, { errorMessage, hash, status, }: {
|
|
652
|
+
errorMessage?: string;
|
|
653
|
+
hash?: string;
|
|
654
|
+
status?: TransactionStatus;
|
|
655
|
+
}): void;
|
|
656
|
+
/**
|
|
657
|
+
* Search transaction metadata for matching entries.
|
|
658
|
+
*
|
|
659
|
+
* @param opts - Options bag.
|
|
660
|
+
* @param opts.searchCriteria - An object containing values or functions for transaction properties to filter transactions with.
|
|
661
|
+
* @param opts.initialList - The transactions to search. Defaults to the current state.
|
|
662
|
+
* @param opts.filterToCurrentNetwork - Whether to filter the results to the current network. Defaults to true.
|
|
663
|
+
* @param opts.limit - The maximum number of transactions to return. No limit by default.
|
|
664
|
+
* @returns An array of transactions matching the provided options.
|
|
665
|
+
*/
|
|
666
|
+
getTransactions({ searchCriteria, initialList, filterToCurrentNetwork, limit, }?: {
|
|
667
|
+
searchCriteria?: any;
|
|
668
|
+
initialList?: TransactionMeta[];
|
|
669
|
+
filterToCurrentNetwork?: boolean;
|
|
670
|
+
limit?: number;
|
|
671
|
+
}): TransactionMeta[];
|
|
672
|
+
estimateGasFee({ transactionParams, chainId, networkClientId: requestNetworkClientId, }: {
|
|
673
|
+
transactionParams: TransactionParams;
|
|
674
|
+
chainId?: Hex;
|
|
675
|
+
networkClientId?: NetworkClientId;
|
|
676
|
+
}): Promise<GasFeeFlowResponse>;
|
|
677
|
+
/**
|
|
678
|
+
* Determine the layer 1 gas fee for the given transaction parameters.
|
|
679
|
+
*
|
|
680
|
+
* @param request - The request object.
|
|
681
|
+
* @param request.transactionParams - The transaction parameters to estimate the layer 1 gas fee for.
|
|
682
|
+
* @param request.chainId - The ID of the chain where the transaction will be executed.
|
|
683
|
+
* @param request.networkClientId - The ID of a specific network client to process the transaction.
|
|
684
|
+
*/
|
|
685
|
+
getLayer1GasFee({ transactionParams, chainId, networkClientId, }: {
|
|
686
|
+
transactionParams: TransactionParams;
|
|
687
|
+
chainId?: Hex;
|
|
688
|
+
networkClientId?: NetworkClientId;
|
|
689
|
+
}): Promise<Hex | undefined>;
|
|
690
|
+
private signExternalTransaction;
|
|
691
|
+
/**
|
|
692
|
+
* Removes unapproved transactions from state.
|
|
693
|
+
*/
|
|
694
|
+
clearUnapprovedTransactions(): void;
|
|
695
|
+
/**
|
|
696
|
+
* Stop the signing process for a specific transaction.
|
|
697
|
+
* Throws an error causing the transaction status to be set to failed.
|
|
698
|
+
* @param transactionId - The ID of the transaction to stop signing.
|
|
699
|
+
*/
|
|
700
|
+
abortTransactionSigning(transactionId: string): void;
|
|
701
|
+
private addMetadata;
|
|
702
|
+
private updateGasProperties;
|
|
703
|
+
private onBootCleanup;
|
|
704
|
+
private failIncompleteTransactions;
|
|
705
|
+
private processApproval;
|
|
706
|
+
/**
|
|
707
|
+
* Approves a transaction and updates it's status in state. If this is not a
|
|
708
|
+
* retry transaction, a nonce will be generated. The transaction is signed
|
|
709
|
+
* using the sign configuration property, then published to the blockchain.
|
|
710
|
+
* A `<tx.id>:finished` hub event is fired after success or failure.
|
|
711
|
+
*
|
|
712
|
+
* @param transactionId - The ID of the transaction to approve.
|
|
713
|
+
* @param traceContext - The parent context for any new traces.
|
|
714
|
+
*/
|
|
715
|
+
private approveTransaction;
|
|
716
|
+
private publishTransaction;
|
|
717
|
+
/**
|
|
718
|
+
* Cancels a transaction based on its ID by setting its status to "rejected"
|
|
719
|
+
* and emitting a `<tx.id>:finished` hub event.
|
|
720
|
+
*
|
|
721
|
+
* @param transactionId - The ID of the transaction to cancel.
|
|
722
|
+
* @param actionId - The actionId passed from UI
|
|
723
|
+
*/
|
|
724
|
+
private cancelTransaction;
|
|
725
|
+
/**
|
|
726
|
+
* Trim the amount of transactions that are set on the state. Checks
|
|
727
|
+
* if the length of the tx history is longer then desired persistence
|
|
728
|
+
* limit and then if it is removes the oldest confirmed or rejected tx.
|
|
729
|
+
* Pending or unapproved transactions will not be removed by this
|
|
730
|
+
* operation. For safety of presenting a fully functional transaction UI
|
|
731
|
+
* representation, this function will not break apart transactions with the
|
|
732
|
+
* same nonce, created on the same day, per network. Not accounting for
|
|
733
|
+
* transactions of the same nonce, same day and network combo can result in
|
|
734
|
+
* confusing or broken experiences in the UI.
|
|
735
|
+
*
|
|
736
|
+
* @param transactions - The transactions to be applied to the state.
|
|
737
|
+
* @returns The trimmed list of transactions.
|
|
738
|
+
*/
|
|
739
|
+
private trimTransactionsForState;
|
|
740
|
+
/**
|
|
741
|
+
* Determines if the transaction is in a final state.
|
|
742
|
+
*
|
|
743
|
+
* @param status - The transaction status.
|
|
744
|
+
* @returns Whether the transaction is in a final state.
|
|
745
|
+
*/
|
|
746
|
+
private isFinalState;
|
|
747
|
+
/**
|
|
748
|
+
* Whether the transaction has at least completed all local processing.
|
|
749
|
+
*
|
|
750
|
+
* @param status - The transaction status.
|
|
751
|
+
* @returns Whether the transaction is in a final state.
|
|
752
|
+
*/
|
|
753
|
+
private isLocalFinalState;
|
|
754
|
+
private requestApproval;
|
|
755
|
+
private getTransaction;
|
|
756
|
+
private getTransactionOrThrow;
|
|
757
|
+
private getApprovalId;
|
|
758
|
+
private isTransactionCompleted;
|
|
759
|
+
private getChainId;
|
|
760
|
+
private prepareUnsignedEthTx;
|
|
761
|
+
/**
|
|
762
|
+
* `@ethereumjs/tx` uses `@ethereumjs/common` as a configuration tool for
|
|
763
|
+
* specifying which chain, network, hardfork and EIPs to support for
|
|
764
|
+
* a transaction. By referencing this configuration, and analyzing the fields
|
|
765
|
+
* specified in txParams, @ethereumjs/tx is able to determine which EIP-2718
|
|
766
|
+
* transaction type to use.
|
|
767
|
+
*
|
|
768
|
+
* @param chainId - The chainId to use for the configuration.
|
|
769
|
+
* @returns common configuration object
|
|
770
|
+
*/
|
|
771
|
+
private getCommonConfiguration;
|
|
772
|
+
private onIncomingTransactions;
|
|
773
|
+
private onUpdatedLastFetchedBlockNumbers;
|
|
774
|
+
private generateDappSuggestedGasFees;
|
|
775
|
+
/**
|
|
776
|
+
* Validates and adds external provided transaction to state.
|
|
777
|
+
*
|
|
778
|
+
* @param transactionMeta - Nominated external transaction to be added to state.
|
|
779
|
+
* @returns The new transaction.
|
|
780
|
+
*/
|
|
781
|
+
private addExternalTransaction;
|
|
782
|
+
/**
|
|
783
|
+
* Sets other txMeta statuses to dropped if the txMeta that has been confirmed has other transactions
|
|
784
|
+
* in the transactions have the same nonce.
|
|
785
|
+
*
|
|
786
|
+
* @param transactionId - Used to identify original transaction.
|
|
787
|
+
*/
|
|
788
|
+
private markNonceDuplicatesDropped;
|
|
789
|
+
/**
|
|
790
|
+
* Method to set transaction status to dropped.
|
|
791
|
+
*
|
|
792
|
+
* @param transactionMeta - TransactionMeta of transaction to be marked as dropped.
|
|
793
|
+
*/
|
|
794
|
+
private setTransactionStatusDropped;
|
|
795
|
+
/**
|
|
796
|
+
* Get transaction with provided actionId.
|
|
797
|
+
*
|
|
798
|
+
* @param actionId - Unique ID to prevent duplicate requests
|
|
799
|
+
* @returns the filtered transaction
|
|
800
|
+
*/
|
|
801
|
+
private getTransactionWithActionId;
|
|
802
|
+
private waitForTransactionFinished;
|
|
803
|
+
/**
|
|
804
|
+
* Updates the r, s, and v properties of a TransactionMeta object
|
|
805
|
+
* with values from a signed transaction.
|
|
806
|
+
*
|
|
807
|
+
* @param transactionMeta - The TransactionMeta object to update.
|
|
808
|
+
* @param signedTx - The encompassing type for all transaction types containing r, s, and v values.
|
|
809
|
+
* @returns The updated TransactionMeta object.
|
|
810
|
+
*/
|
|
811
|
+
private updateTransactionMetaRSV;
|
|
812
|
+
private getEIP1559Compatibility;
|
|
813
|
+
private signTransaction;
|
|
814
|
+
private onTransactionStatusChange;
|
|
815
|
+
private getNonceTrackerTransactions;
|
|
816
|
+
private onConfirmedTransaction;
|
|
817
|
+
private updatePostBalance;
|
|
818
|
+
private publishTransactionForRetry;
|
|
819
|
+
/**
|
|
820
|
+
* Ensures that error is a nonce issue
|
|
821
|
+
*
|
|
822
|
+
* @param error - The error to check
|
|
823
|
+
* @returns Whether or not the error is a nonce issue
|
|
824
|
+
*/
|
|
825
|
+
private isTransactionAlreadyConfirmedError;
|
|
826
|
+
}
|
|
827
|
+
export {};
|
|
828
|
+
//# sourceMappingURL=TransactionController.d.mts.map
|