tessl install tessl/npm-walletconnect--types@2.21.0TypeScript type definitions and interfaces for the WalletConnect Protocol v2, enabling type-safe development across the WalletConnect ecosystem
Agent Success
Agent success rate when using this tile
70%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.19x
Baseline
Agent success rate without this tile
59%
Build a session manager utility that handles WalletConnect sessions using alternative transport methods, specifically focusing on link mode support for direct peer-to-peer connections.
Create a TypeScript utility that manages WalletConnect session metadata and transport configurations. The utility should:
Your solution should include:
SessionManager class that stores and manages multiple sessions@walletconnect/typesimport { SessionTypes, RelayerTypes } from '@walletconnect/types';
/**
* Manages WalletConnect sessions with link mode support
*/
export class SessionManager {
/**
* Adds a session to the manager
* @param session - The WalletConnect session structure
*/
addSession(session: SessionTypes.Struct): void;
/**
* Generates a deep link URL for the given session topic if link mode is supported
* @param topic - The session topic
* @returns The deep link URL or null if link mode is not available
*/
generateDeepLink(topic: string): string | null;
/**
* Returns all sessions using the specified transport type
* @param transportType - The transport type to filter by ('relay' or 'link_mode')
* @returns Array of matching sessions
*/
getSessionsByTransport(transportType: RelayerTypes.TransportTypes): SessionTypes.Struct[];
/**
* Checks if a session has link mode capability
* @param topic - The session topic
* @returns true if the session peer supports link mode
*/
hasLinkModeSupport(topic: string): boolean;
}getSessionsByTransport('relay') returns it @testhasLinkModeSupport returns true, and generateDeepLink produces a valid deep link URL @testgenerateDeepLink returns null @test@generates
Provides TypeScript type definitions for WalletConnect Protocol v2, including session structures, transport types, and core metadata types.