Back
+20 XP
2/12
Challenge: Wallet Connection Flow
Simulate a wallet connection flow by generating a keypair (representing a wallet) and extracting key information.
Requirements
- Create a function that simulates connecting to a wallet
- Generate a new keypair to represent the wallet
- Validate that the public key is on the ed25519 curve
- Return an object with
publicKey(base58 string),connected(boolean), andisValid(boolean)
Test Cases
Should return object with publicKey (string), connected (boolean), isValid (boolean)
Input:
Expected: typeof result.publicKey === 'string' && typeof result.connected === 'boolean' && typeof result.isValid === 'boolean'Public key should be a valid base58 string
Input:
Expected: result.publicKey.length >= 32 && result.publicKey.length <= 44