This PR adds a number of new fields to the TransactionMeta type to facilitate Bridge transactions.
We track overall Bridge status through a new BridgeStatusController in Extension. However, that assumes that transactions have a txHash on the source chain that can be used as a reference. For smart transactions (STX), a txHash is not returned immediately. Therefore, we need to attach some additional data to the txMeta so we can properly display information about the transaction even when there is no txHash.
Even if STX returns a txHash right away, it's gated behind a feature flag, which means it can be disabled at any time so we need to have a backup in place.
Explanation
This PR adds a number of new fields to the
TransactionMeta
type to facilitate Bridge transactions.We track overall Bridge status through a new
BridgeStatusController
in Extension. However, that assumes that transactions have atxHash
on the source chain that can be used as a reference. For smart transactions (STX), atxHash
is not returned immediately. Therefore, we need to attach some additional data to thetxMeta
so we can properly display information about the transaction even when there is notxHash
.Even if STX returns a
txHash
right away, it's gated behind a feature flag, which means it can be disabled at any time so we need to have a backup in place.References
Related to https://github.com/MetaMask/metamask-extension/pull/27740, https://github.com/MetaMask/metamask-extension/pull/28460
Changelog
@metamask/transaction-controller
bridgeSteps
,destinationChainId
to theTransactionMeta
typeaddTransaction()
, update thetxMeta
object through theswaps.meta
field when it is a Bridge tx, similar to what happens when it's a Swap txTransactionControllerTransactionNewBridgeApprovalEvent
,TransactionControllerTransactionNewBridgeEvent
eventsChecklist