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 utility that creates and validates multi-chain session configurations for blockchain applications. The tool should handle different blockchain networks and their supported operations.
Create a configuration builder that:
Your builder should accept inputs specifying:
Support two types of capabilities:
The configuration must satisfy:
@generates
/**
* Represents a blockchain namespace configuration
*/
export interface NamespaceConfig {
chains: string[];
methods: string[];
events: string[];
accounts: string[];
}
/**
* Configuration input for a single blockchain
*/
export interface ChainInput {
chainId: string;
accounts: string[];
methods: string[];
events: string[];
}
/**
* Session configuration with required and optional namespaces
*/
export interface SessionConfig {
requiredNamespaces?: Record<string, NamespaceConfig>;
optionalNamespaces?: Record<string, NamespaceConfig>;
}
/**
* Builds a session configuration with required namespaces
*/
export function buildRequiredNamespaces(chains: ChainInput[]): SessionConfig;
/**
* Builds a session configuration with optional namespaces
*/
export function buildOptionalNamespaces(chains: ChainInput[]): SessionConfig;
/**
* Builds a session configuration with both required and optional namespaces
*/
export function buildSessionConfig(
required: ChainInput[],
optional: ChainInput[]
): SessionConfig;
/**
* Validates a namespace configuration
* Throws an error if validation fails
*/
export function validateNamespaceConfig(config: NamespaceConfig): void;Provides TypeScript type definitions for WalletConnect Protocol v2, including session and namespace types.
@satisfied-by