
Company News
Andrew Becherer Joins Socket as Chief Information Security Officer
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.
@gemini-wallet/core
Advanced tools
Core SDK for integrating with Gemini Wallet through secure popup-based communication.
@gemini-wallet/core provides the fundamental communication layer for interacting with Gemini Wallet. It handles secure cross-origin communication via the postMessage API, managing popup windows for user authentication and transaction approvals.
npm install @gemini-wallet/core
# or
yarn add @gemini-wallet/core
# or
pnpm add @gemini-wallet/core
import { Communicator, GeminiSdkEvent } from '@gemini-wallet/core';
// Initialize the communicator
const communicator = new Communicator({
appMetadata: {
name: 'My DApp',
description: 'My decentralized application',
url: 'https://mydapp.com',
icons: ['https://mydapp.com/icon.png']
},
onDisconnectCallback: () => {
console.log('Wallet disconnected');
}
});
// Send a connect request
const connectMessage = {
event: GeminiSdkEvent.SDK_CONNECT,
requestId: crypto.randomUUID(),
chainId: 1,
origin: window.location.origin
};
const response = await communicator.postRequestAndWaitForResponse(connectMessage);
console.log('Connected:', response.data.address);
// Listen for specific events
communicator.onMessage(
(message) => message.event === GeminiSdkEvent.ACCOUNTS_CHANGED
).then(response => {
console.log('Accounts changed:', response.data);
});
// Send transaction
const txMessage = {
event: GeminiSdkEvent.SDK_SEND_TRANSACTION,
requestId: crypto.randomUUID(),
chainId: 1,
origin: window.location.origin,
data: {
from: '0x...',
to: '0x...',
value: '1000000000000000000', // 1 ETH in wei
data: '0x'
}
};
const txResponse = await communicator.postRequestAndWaitForResponse(txMessage);
console.log('Transaction hash:', txResponse.hash);
The main class for handling communication with Gemini Wallet.
interface CommunicatorConfigParams {
appMetadata: AppMetadata;
onDisconnectCallback?: () => void;
}
interface AppMetadata {
name?: string;
description?: string;
url?: string;
icons?: string[];
}
postMessage(message: GeminiSdkMessage): Promise<void>Posts a message to the popup window without waiting for a response.
postRequestAndWaitForResponse<M, R>(request: GeminiSdkMessage): Promise<R>Posts a request and waits for a matching response based on requestId.
onMessage<M, R>(predicate: (message: Partial<M>) => boolean): Promise<R>Listens for messages that match the given predicate.
waitForPopupLoaded(): Promise<Window>Ensures the popup is loaded and ready for communication.
Enumeration of all supported events:
POPUP_LOADED - Popup window has loadedPOPUP_UNLOADED - Popup window was closedPOPUP_APP_CONTEXT - App metadata sent to popupSDK_CONNECT - Connect wallet requestSDK_DISCONNECT - Disconnect wallet requestSDK_SEND_TRANSACTION - Send transaction requestSDK_SIGN_MESSAGE - Sign message requestSDK_SIGN_TYPED_DATA - Sign typed data requestSDK_SWITCH_CHAIN - Switch chain requestACCOUNTS_CHANGED - Accounts changed eventCHAIN_CHANGED - Chain changed eventDISCONNECT - Disconnect eventSDK_BACKEND_URL: "https://keys.gemini.com"DEFAULT_CHAIN_ID: 1 (Ethereum mainnet)POPUP_WIDTH: 420POPUP_HEIGHT: 650We welcome contributions! Please see our Contributing Guide for details.
MIT License - see LICENSE for details.
FAQs
Core SDK for Gemini Wallet integration with popup communication
The npm package @gemini-wallet/core receives a total of 387,916 weekly downloads. As such, @gemini-wallet/core popularity was classified as popular.
We found that @gemini-wallet/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.