MetaMask / core

This monorepo is a collection of packages used across multiple MetaMask clients
MIT License
293 stars 188 forks source link

feat: add more bridge fields to txMeta for Bridge #4918

Open infiniteflower opened 1 week ago

infiniteflower commented 1 week ago

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 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.

References

Related to https://github.com/MetaMask/metamask-extension/pull/27740, https://github.com/MetaMask/metamask-extension/pull/28460

Changelog

@metamask/transaction-controller

Checklist