You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi MetaMask team,
I’m building a custom Snap that needs to create and manage smart contract wallet (SCW) accounts inside my Snap and have it appear in the MetaMask Flask UI. I noticed in the docs that snap_manageAccounts supports submethods like [createAccount, list, update, delete] (https://docs.metamask.io/snaps/reference/snaps-api/#createaccount)
below code handle inside the snap using OnKeyringRequestHandler
case "keyring_createAccount": {
const account = {
id: uuidv4(),
type: "eip155:erc4337",
address: "0x6D544390Eb535d61e196c87d6B9c80dCD8628Acd",
scopes: ["eip155:31337"],
options: { name: "My SCW" },
methods: [],
};
await snap.request({
method: "snap_manageAccounts",
params: {
method: "createAccount",
params: account,
},
});
return account;
}}
In frontend using KeyringSnapRpcClient package to initiate createAccount
const client = new KeyringSnapRpcClient(snapId, window.ethereum);
const account = await client.createAccount({});
but getting : MetaMask - RPC Error: Method not supported: createAccount
myQuestions are
1.Is it true that only allowlisted Snaps can currently create accounts with snap_manageAccounts?
2.my implementaion is wrong ?
if i am wrong, please give me a correct path to implement.
Note : we are used metamask flask for testing
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi MetaMask team,
I’m building a custom Snap that needs to create and manage smart contract wallet (SCW) accounts inside my Snap and have it appear in the MetaMask Flask UI. I noticed in the docs that snap_manageAccounts supports submethods like [createAccount, list, update, delete] (https://docs.metamask.io/snaps/reference/snaps-api/#createaccount)
below code handle inside the snap using OnKeyringRequestHandler
case "keyring_createAccount": {
const account = {
id: uuidv4(),
type: "eip155:erc4337",
address: "0x6D544390Eb535d61e196c87d6B9c80dCD8628Acd",
scopes: ["eip155:31337"],
options: { name: "My SCW" },
methods: [],
};
await snap.request({
method: "snap_manageAccounts",
params: {
method: "createAccount",
params: account,
},
});
return account;
}}
Beta Was this translation helpful? Give feedback.
All reactions