
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
@gemini-wallet/core
Advanced tools
Core SDK for Gemini Wallet integration with popup communication
Complete SDK for integrating with Gemini Wallet, providing wallet connection, transaction signing, and EVM provider functionality.
@gemini-wallet/core
is a comprehensive wallet SDK that provides everything needed to integrate Gemini Wallet into your application. It includes a complete EVM-compatible provider, wallet connection management, secure storage, and seamless popup-based user interactions.
bun add @gemini-wallet/core
# or
npm install @gemini-wallet/core
# or
yarn add @gemini-wallet/core
# or
pnpm add @gemini-wallet/core
For most applications, you should use Wagmi's built-in Gemini connector instead:
import { gemini } from 'wagmi/connectors';
import { createConfig } from 'wagmi';
const config = createConfig({
connectors: [
gemini({
appMetadata: {
name: 'My DApp',
url: 'https://mydapp.com',
}
})
],
// ... rest of wagmi config
});
🎯 Wagmi Integration: Gemini Wallet is available as a default connector in Wagmi v2.x+
📚 Wagmi Docs: wagmi.sh/connectors/gemini
⭐ Status: Currently in PR review - will be available soon!
This core SDK provides multiple integration levels for advanced use cases:
Use when you need direct provider access or aren't using Wagmi:
import { GeminiWalletProvider } from '@gemini-wallet/core';
const provider = new GeminiWalletProvider({
appMetadata: {
name: 'My DApp',
url: 'https://mydapp.com'
},
chain: { id: 42161 }, // Arbitrum One
});
// Connect and get accounts
const accounts = await provider.request({
method: 'eth_requestAccounts'
});
// Send transaction
const txHash = await provider.request({
method: 'eth_sendTransaction',
params: [{
from: accounts[0],
to: '0x742E4C3B7dcD26e7Ca95C0Ad2F38C61f6F02C4c0',
value: '0x38D7EA4C68000', // 0.001 ETH
}]
});
// Listen for events
provider.on('accountsChanged', (accounts) => {
console.log('Accounts changed:', accounts);
});
Use the wallet class for fine-grained control:
import { GeminiWallet } from '@gemini-wallet/core';
const wallet = new GeminiWallet({
appMetadata: {
name: 'My DApp',
url: 'https://mydapp.com'
},
chain: { id: 42161 }
});
// Connect
const accounts = await wallet.connect();
// Send transaction with error handling
const result = await wallet.sendTransaction({
to: '0x742E4C3B7dcD26e7Ca95C0Ad2F38C61f6F02C4c0',
value: '1000000000000000000', // 1 ETH in wei
});
if (result.error) {
console.error('Transaction failed:', result.error);
} else {
console.log('Transaction hash:', result.hash);
}
For maximum control over the popup communication:
import { Communicator, GeminiSdkEvent } from '@gemini-wallet/core';
const communicator = new Communicator({
appMetadata: {
name: 'My DApp',
url: 'https://mydapp.com'
}
});
// Send connect request
const response = await communicator.postRequestAndWaitForResponse({
event: GeminiSdkEvent.SDK_CONNECT,
requestId: crypto.randomUUID(),
chainId: 42161,
origin: window.location.origin
});
console.log('Connected address:', response.data.address);
// Listen for specific events
communicator.onMessage(
(message) => message.event === GeminiSdkEvent.SDK_DISCONNECT
).then(() => {
console.log('User disconnected');
});
EIP-1193 compatible Ethereum provider implementation.
interface GeminiProviderConfig {
appMetadata: AppMetadata;
chain: Chain;
onDisconnectCallback?: () => void;
storage?: IStorage;
}
request<T>(args: RpcRequestArgs): Promise<T>
- Send RPC requestsdisconnect(): Promise<void>
- Disconnect walletopenSettings(): Promise<void>
- Open wallet settingsaccountsChanged
- Emitted when accounts changechainChanged
- Emitted when chain changesconnect
- Emitted on connectiondisconnect
- Emitted on disconnectionDirect wallet interface for advanced use cases.
interface GeminiWalletConfig {
appMetadata: AppMetadata;
chain?: Chain;
onDisconnectCallback?: () => void;
storage?: IStorage;
}
connect(): Promise<Address[]>
- Connect to walletsendTransaction(tx: TransactionRequest): Promise<SendTransactionResponse>
- Send transactionsignData(params: SignMessageParameters): Promise<SignMessageResponse>
- Sign messagesignTypedData(params: SignTypedDataParameters): Promise<SignTypedDataResponse>
- Sign typed dataswitchChain(params: SwitchChainParameters): Promise<string | null>
- Switch chainsopenSettings(): Promise<void>
- Open wallet settingsStorage interface for persisting wallet state.
interface IStorage {
setItem(key: string, value: string): Promise<void>;
getItem(key: string): Promise<string | null>;
removeItem(key: string): Promise<void>;
storeObject<T>(key: string, item: T): Promise<void>;
loadObject<T>(key: string, fallback: T): Promise<T>;
}
Low-level communication class.
interface CommunicatorConfigParams {
appMetadata: AppMetadata;
onDisconnectCallback?: () => void;
}
postMessage(message: GeminiSdkMessage): Promise<void>
- Send messagepostRequestAndWaitForResponse<M, R>(request: GeminiSdkMessage): Promise<R>
- Send request and waitonMessage<M, R>(predicate: (message: Partial<M>) => boolean): Promise<R>
- Listen for messageswaitForPopupLoaded(): Promise<Window>
- Wait for popup to loadEnumeration 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 eventGemini Wallet supports the following networks:
Mainnets:
Testnets:
SDK_BACKEND_URL
: "https://keys.gemini.com"
DEFAULT_CHAIN_ID
: 42161
(Arbitrum One)SUPPORTED_CHAIN_IDS
: Array of supported chain IDsPOPUP_WIDTH
: 420
POPUP_HEIGHT
: 650
Experience Gemini Wallet in action:
🔗 keys.gemini.com - Try the wallet interface and see how the SDK integrations work
The core SDK enables various integration patterns:
This project uses Bun as the package manager and build tool.
# Install dependencies
bun install
# Run tests
bun test
# Run tests in watch mode
bun test --watch
# Type checking
bun run typecheck
# Build the package
bun run build
# Development mode (watch mode)
bun run dev
bun run build
- Build the package for productionbun run dev
- Build in watch mode for developmentbun run test
- Run testsbun run test:watch
- Run tests in watch modebun run typecheck
- Run TypeScript type checkingbun run lint
- Run ESLint (requires configuration)bun run lint:fix
- Fix ESLint issues automaticallyThe build process generates:
dist/index.js
- ESM bundle for Node.jsdist/index.d.ts
- TypeScript declarationsdist/*.d.ts.map
- Source maps for declarationsWe 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 75,429 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.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.