Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update metamask wallet_watchAsset #384

Merged
merged 1 commit into from
Sep 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/components/Transfer/AddToMetamask.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,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: {
Expand All @@ -63,7 +64,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
},
Expand Down
Loading