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
Returns publicKey, connected and isValid with correct types
Input:
Expected: typeof result.publicKey === 'string' && typeof result.connected === 'boolean' && typeof result.isValid === 'boolean'publicKey has a valid base58 length
Input:
Expected: result.publicKey.length >= 32 && result.publicKey.length <= 44Wallet is connected and the key is on-curve
Input:
Expected: result.connected === true && result.isValid === true