TypeScript type definitions and interfaces for the WalletConnect Protocol v2, enabling type-safe development across the WalletConnect ecosystem
70
Build a secure credential manager that stores and retrieves sensitive authentication data.
Create a credential manager that:
The manager should store credentials with the following structure:
key: A unique identifier (string)value: The sensitive data to store (string)The manager should accept a key and value, and store them securely. If a credential with the same key already exists, it should be updated.
The manager should retrieve a credential by its key. If the key doesn't exist, return undefined.
The manager should be able to retrieve all stored credential keys (not the values for security).
The manager should support:
undefined @testundefined @test@generates
/**
* Manages secure storage and retrieval of credentials
*/
export class CredentialManager {
/**
* Stores a credential securely
* @param key - The unique identifier for the credential
* @param value - The sensitive data to store
*/
set(key: string, value: string): Promise<void>;
/**
* Retrieves a credential by key
* @param key - The unique identifier for the credential
* @returns The stored value or undefined if not found
*/
get(key: string): Promise<string | undefined>;
/**
* Lists all stored credential keys
* @returns Array of all credential keys
*/
getAll(): Promise<string[]>;
/**
* Deletes a specific credential
* @param key - The unique identifier for the credential to delete
*/
delete(key: string): Promise<void>;
/**
* Clears all stored credentials
*/
clear(): Promise<void>;
}Provides secure keychain storage interfaces for managing sensitive data.
Install with Tessl CLI
npx tessl i tessl/npm-walletconnect--typesevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10