Metamask Cosmos Snap
Installation
To either establish a connection or initiate an installation followed by a connection to the metamask-cosmos-snap, execute the following code:
try {
const result = await window.ethereum.request({
method: 'wallet_requestSnaps',
params: {
'npm:@leapwallet/metamask-cosmos-snap': {},
},
});
console.log(result);
} catch (error) {
console.log(error);
}
For the official docs on connecting or installing a Metamask snap, refer here.
Methods
1. Get Keys
The getKey method retrieves the wallet's public address corresponding to a specific chain ID. Currently, we support chains of coin type 118.
Usage:
2. Sign Direct
Utilize the signDirect method to sign transactions or signDoc using the connected wallet.
Usage:
3. Suggest Chain
Utilize the suggestChain method to suggest any chains of coin types 118,
Usage:
Last updated