From 67341b1e7750d25abd84739a1d51677e3cf92f11 Mon Sep 17 00:00:00 2001 From: Evan Gray Date: Tue, 5 Sep 2023 17:18:00 -0400 Subject: [PATCH] update metamask wallet_watchAsset --- src/components/Transfer/AddToMetamask.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Transfer/AddToMetamask.tsx b/src/components/Transfer/AddToMetamask.tsx index 4a42fe9..f3ac98a 100644 --- a/src/components/Transfer/AddToMetamask.tsx +++ b/src/components/Transfer/AddToMetamask.tsx @@ -45,6 +45,7 @@ export default function AddToMetamask() { signerAddress ); const ethereum = (await detectEthereumProvider()) as any; + // https://docs.metamask.io/wallet/reference/wallet_watchasset/ ethereum.request({ method: "wallet_watchAsset", params: { @@ -55,7 +56,7 @@ export default function AddToMetamask() { symbol || sourceParsedTokenAccount?.symbol || "wh" - ).substr(0, 5), // A ticker symbol or shorthand, up to 5 characters + ).substring(0, 11), // A ticker symbol or shorthand, up to 11 characters as of 2023-09-05 decimals, // The number of token decimals // image: string; // A string url of the token logo },