Title says it all, want to know if user signs with hot wallet or ledger.
-
3As far as I know, if the user is using a Wallet Extension such as Phantom Wallet to connect their hardware wallet, there is no way to detect whether it is a hardware wallet. That is because the extension acts as if the connected wallet was a casual extension wallet and therefore your application won't be able to understand.– OguzhanCommented Dec 19, 2022 at 15:57
Add a comment
|
1 Answer
If the user is using Ledger extension, then yes. Using Solana wallet adapter, you can get the connected wallet's name and match is it "Ledger". Example:
const { wallet } = useWallet()
console.log(wallet.adapter.name) // This will print wallet name
Wallet adapter documentation: https://solana-labs.github.io/wallet-adapter/
However, if the user is using Ledger connected to let's say Phantom or Solflare, then there is no way to know if the user signed the transaction using hardware wallet or not.