
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
@etherplay/wallet-connector
Advanced tools
Core wallet connector interfaces and types for @etherplay/connect - provides the foundation for wallet provider implementations across different blockchain networks
Core wallet connector interfaces and types for the @etherplay/connect ecosystem. This package provides the foundational abstractions for wallet provider implementations across different blockchain networks.
npm install @etherplay/wallet-connector
# or
pnpm add @etherplay/wallet-connector
# or
yarn add @etherplay/wallet-connector
This package defines the core interfaces and types used by wallet connector implementations. It serves as the foundation for building wallet integrations that work consistently across different blockchain networks.
Represents a wallet with its provider and metadata:
type WalletHandle<UnderlyingProvider> = {
walletProvider: WalletProvider<UnderlyingProvider>;
info: WalletInfo;
};
Metadata about a wallet:
type WalletInfo = {
uuid: string;
name: string;
icon: string;
rdns: string;
};
Information about a blockchain network:
type ChainInfo = Readonly<{
chainId: `0x${string}`;
rpcUrls?: readonly string[];
blockExplorerUrls?: readonly string[];
chainName?: string;
iconUrls?: readonly string[];
nativeCurrency?: Readonly<{
name: string;
symbol: string;
decimals: number;
}>;
}>;
Interface for generating accounts from mnemonics:
interface AccountGenerator {
fromMnemonicToAccount(mnemonic: string, index: number): PrivateKeyAccount;
signTextMessage(message: string, privateKey: `0x${string}`): Promise<`0x${string}`>;
type: string;
}
Main interface for wallet connector implementations:
interface WalletConnector<UnderlyingProvider> {
fetchWallets(walletAnnounced: (walletHandle: WalletHandle<UnderlyingProvider>) => void): void;
createAlwaysOnProvider(params: {
endpoint: string | UnderlyingProvider;
chainId: string;
prioritizeWalletProvider?: boolean;
requestsPerSecond?: number;
}): AlwaysOnProviderWrapper<UnderlyingProvider>;
accountGenerator: AccountGenerator;
}
Interface for wallet provider interactions:
interface WalletProvider<UnderlyingProvider> extends BasicWalletProvider<UnderlyingProvider> {
listenForAccountsChanged: (handler: (accounts: `0x${string}`[]) => void) => void;
stopListenForAccountsChanged: (handler: (accounts: `0x${string}`[]) => void) => void;
listenForChainChanged: (handler: (chainId: `0x${string}`) => void) => void;
stopListenForChainChanged: (handler: (chainId: `0x${string}`) => void) => void;
switchChain: (chainId: `0x${string}`) => Promise<null | any>;
addChain(chainInfo: ChainInfo): Promise<null | any>;
}
Wrapper for providers that should always be available:
interface AlwaysOnProviderWrapper<WalletProviderType> {
setWalletProvider: (walletProvider: WalletProviderType | undefined) => void;
setWalletStatus: (newStatus: 'connected' | 'locked' | 'disconnected') => void;
chainId: string;
provider: WalletProviderType;
}
This package is primarily used as a dependency for implementing blockchain-specific wallet connectors:
import type {WalletConnector, WalletProvider, AccountGenerator, ChainInfo} from '@etherplay/wallet-connector';
// Implement a custom wallet connector
class MyWalletConnector implements WalletConnector<MyProvider> {
// ... implementation
}
@etherplay/wallet-connector-ethereum - Ethereum implementation of the wallet connector@etherplay/connect - Main connection library that uses wallet connectors@etherplay/alchemy - Social login mechanisms for account generationMIT
FAQs
Core wallet connector interfaces and types for @etherplay/connect - provides the foundation for wallet provider implementations across different blockchain networks
We found that @etherplay/wallet-connector demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.