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();
console.log(publicKey);
// above code output
f97e2dcb3a73eff50b54e9270eb6ccdd2d6ca249c7311c9a6b58a4dd180c7757

Last updated