Conversation
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
|
@metamaskbot publish-previews |
| | { | ||
| accountType: EvmAccountType; | ||
| assetId: Hex; // This is also the address for EVM tokens | ||
| assetId: CaipAssetType; |
There was a problem hiding this comment.
This is a breaking change result from the bad decision in BIP44 days of setting assetId as the address for evm assets, which is very confusing and means we have no access to the assetId at all.
This is the main change of this PR.
| chainId: `${string}:${string}`; | ||
| assetId: CaipAssetType; | ||
| address: CaipAssetType; | ||
| chainId: CaipChainId; |
There was a problem hiding this comment.
No breaking changes here, just using the correct type.
Added address here too, because otherwise the type is annoying to handle (it won't let you access asset.address as it doesn't always exist. The PRs implementing this breaking change show how this can simplify the code.
| hexToNumber(chainId).toString(), | ||
| 'erc20', | ||
| ZERO_ADDRESS, | ||
| ), |
There was a problem hiding this comment.
We need a default here, and erc20:0x0000...0000 is a better default than slip44:60, as it usually works even when there is a slip44 entry and it doesn't assume it's ETH. It does assume that the native token is the zero address, but there is only a handful of chains for which that is not the case, and we hopefully have the captured in the settings.
|
@metamaskbot publish-previews |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
Explanation
assetIdis being populated with the evm address for evm assets, which is both confusing and makes it cumbersome to extract the realassetIdin the clients.References
Checklist