From 7c3ff51b33021e7710da47ddee3eeb1d17f04982 Mon Sep 17 00:00:00 2001 From: Chris Smith <1979423+chris13524@users.noreply.github.com> Date: Wed, 2 Apr 2025 11:21:45 -0700 Subject: [PATCH] Update erc-7811.md --- ERCS/erc-7811.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ERCS/erc-7811.md b/ERCS/erc-7811.md index 75a7734bd1f..11b3bdd8360 100644 --- a/ERCS/erc-7811.md +++ b/ERCS/erc-7811.md @@ -262,6 +262,26 @@ Wallet **SHOULD** include this for every chainId. } ``` +## Dapp Migration + +Dapps often rely on various backend services such as RPC or asset balance aggregators in order to display balances to the user or to restrict the actions the user can take in order to preserve user experience. It is recommended that apps take advantage of `wallet_getAssets` where possible to check what assets the user has to spend. + +In order to further simplify dapp migration, it is recommended that libraries providing provider-compatible (TODO link ERC) implementations polyfill `wallet_getAssets` for wallet connections that do not support it. The response SHOULD be a simple balance check for the chain only, as it is not known what abstraction capabilities the wallet has. + +Some dapps may not trust the `wallet_getAssets` value is correct or up-to-date with the latest balance, when compared with the current portfolio solution being used. In these cases it is recommended for dapps to merge the results of `wallet_getAssets` and their current solution by taking the maximum value of the two. + +## Dapp use cases + +When would dapps want to call this? + +### Checking total spendable balance for an asset + +E.g. DEX example with checking if enough USDC to execute the swap + +### Checking available assets to spend - select token UI + +E.g. DEX example, what assets do I have... greater than >$0.01 in value? + ## Rationale