Martian Wallet Dev Docs
HomeChrome web store
  • Introduction
  • 🏗️Integration
    • Detecting the Provider
    • Establishing a Connection
    • Displaying Your App
  • ⚙️methods
    • Aptos
      • Generate Transaction
      • Sign Transaction
      • Submit Transaction
      • Sign and Submit Transaction
      • Sign Generic Transaction
      • Generate Sign and Submit Transaction
      • Create Collection
      • Create Token
      • Add Network
      • Change Network
      • Get Networks
      • Get Transaction
      • Get Transactions
      • Get Account Transactions
      • Get Account Resources
      • Get Account
      • Get Chain Id
      • Get Ledger Info
    • Sui
      • Sign Transaction Block
      • Sign and Execute Transaction
      • Get Public Key
      • Get Old Address
      • Get Accounts
    • Sign Message
    • Get Network
    • Get Current Blockchain
    • Cancel Submitted Transactions
    • Network Change Event
    • Account Change Event
Powered by GitBook
On this page
  1. methods
  2. Sui

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
PreviousSign and Execute TransactionNextGet Old Address

Last updated 2 years ago

⚙️