snap_getBip44Entropy command #985
Replies: 4 comments 10 replies
-
|
Hello @MrDonaldBean, To help you out, I'd need a complete, but minimal, snap example. I also need to understand it clearly, could you please format your question in a more understandable way? Having the code properly quoted would be very helpful. |
Beta Was this translation helpful? Give feedback.
-
|
Sorry, I'll try to properly quotes. Basically I've:
code<1>: code<2>: import { getBIP44AddressKeyDeriver } from '@metamask/key-tree';
// By way of example, we will use Dogecoin, which has coin_type 3.
const dogecoinNode = await wallet.request({
method: 'snap_getBip44Entropy',
params: {
coinType: 3,
},
});
// Next, we'll create an address key deriver function for the Dogecoin coin_type node.
// In this case, its path will be: m / 44' / 3' / 0' / 0 / address_index
const deriveDogecoinAddress = await getBIP44AddressKeyDeriver(dogecoinNode);
// These are BIP-44 nodes containing the extended private keys for
// the respective derivation paths.
// m / 44' / 3' / 0' / 0 / 0
const addressKey0 = await deriveDogecoinAddress(0);
// m / 44' / 3' / 0' / 0 / 1
const addressKey1 = await deriveDogecoinAddress(1);
// Now, you can ask the user to e.g. sign transactions!` |
Beta Was this translation helpful? Give feedback.
-
|
I see you're requesting For example exports.onRpcRequest = async () => {
const dogecoinNode = await wallet.request({
method: 'snap_getBip44Entropy',
params: { coinType: 3 },
});
}; |
Beta Was this translation helpful? Give feedback.
-
|
This is (maybe) what I was looking for: https://github.com/metamask/test-snaps/tree/main/packages/bip44 Problem is that when I click "connect to bip-44 snap" it gives me this error: "The method "wallet_requestSnaps" does not exist / is not available."...any clues for this error? Sorry if this is another dummy question |
Beta Was this translation helpful? Give feedback.



Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm a really noob user.
I'd like to use the snap_getBip44Entropy command...I've run correctly the "confirmation screen" example of the "getting started" tutorial and I've installed @metamaks/key-tree.
Then I've copied:
{
"initialPermissions": {
"snap_getBip44Entropy": [
{
"coinType": 3
}
]
}
}
in snap.manifest.json and:
import { getBIP44AddressKeyDeriver } from '@metamask/key-tree';
// By way of example, we will use Dogecoin, which has
coin_type3.const dogecoinNode = await wallet.request({
method: 'snap_getBip44Entropy',
params: {
coinType: 3,
},
});
// Next, we'll create an address key deriver function for the Dogecoin coin_type node.
// In this case, its path will be: m / 44' / 3' / 0' / 0 / address_index
const deriveDogecoinAddress = await getBIP44AddressKeyDeriver(dogecoinNode);
// These are BIP-44 nodes containing the extended private keys for
// the respective derivation paths.
// m / 44' / 3' / 0' / 0 / 0
const addressKey0 = await deriveDogecoinAddress(0);
// m / 44' / 3' / 0' / 0 / 1
const addressKey1 = await deriveDogecoinAddress(1);
// Now, you can ask the user to e.g. sign transactions!
in index.ts
I'm trying to run it but it gives me an error...what am I missing?
Really really sorry for the dummy question, I hope that someone can help me.
I've looked for guides and similar discussions but I wasn't able to get it by myself (it's more than 2 days that I'm stopped here...as I said I'm a noob, unfortunately).
Thanks again
Beta Was this translation helpful? Give feedback.
All reactions