Please add wallet_getAssets
method to TokenController
, or silently ignore wallet_watchAssets
if token already added
#880
Labels
TokenController
defines a functionwatchAsset
which implements EIP-747'swallet_getAssets
.This EIP does not specify a way to determine whether a wallet already contains the given asset. This means that a dapp connecting to MetaMask cannot automatically keep suggesting their token, otherwise users are presented with the following warning the second and subsequent time
wallet_watchAssets
is called, if the user added the token the first timewallet_watchAssets
was called:Unfortunately this warning is shown whether or not the options submitted to
watchAsset
exactly match a token already in the wallet.I propose two possible solutions:
wallet_getAssets
RPC call that returns the fouroptions
(address
,symbol
,decimals
,image
) provided towallet_watchAssets
, for all assets registered in the wallet.wallet_watchAssets
calls if the wallet already includes a token whoseoptions
exactly match all four of theoptions
provided towallet_watchAssets
.The text was updated successfully, but these errors were encountered: