Ed25519 Private Key
The getEd25519PrivateKey method returns the user's Ed25519 private key.
Use this key to sign transactions on Solana, Near, Algorand, and other chains that use the Ed25519
curve.
This method throws:
Web3AuthError.noUserFoundif no user session exists.Web3AuthError.ed25519KeyNotFoundif the session has no Ed25519 key. This always happens for users who signed in with anidToken(single-factor authentication), because SFA sign-in doesn't return an Ed25519 key.Web3AuthError.ed25519CustomAuthErrorifuseSFAKeyistrueand the dashboard marks the user's auth connection as not default (isDefaultisfalse).
When you set useSFAKey to true in Web3AuthOptions, this method returns the single-factor
authentication (SFA) Ed25519 key.
Usage
let ed25519PrivateKey = try web3Auth.getEd25519PrivateKey()