Get Public Key

This method can be used to fetch the account's public key.

Note: returned string would not contain 0x prefix

This code demonstrates how to use the getPublicKey() method to fetch the public key of an account on the Sui network using Martian wallet.

// Fetch transaction details
await window.martian.sui.connect(['viewAccount', 'suggestTransactions']);
const publicKey = await window.martian.sui.getPublicKey();
// above code output

Last updated