# Eclipse Global Wallet

The Eclipse Global Wallet is a plug-and-play wallet integration powered by Dynamic, designed to provide a **self-custodial**, **cross-app** login experience for users across the Eclipse ecosystem. It follows the [Solana Wallet Standard](https://github.com/solana-labs/wallet-standard), ensuring compatibility with any SVM-native wallet adapter.

> 📦 NPM: [@eclipse-laboratories-inc/eclipse-global-wallet](https://www.npmjs.com/package/@eclipse-laboratories-inc/eclipse-global-wallet)

***

#### ✅ Installation

```bash
npm i @eclipse-laboratories-inc/eclipse-global-wallet
# or
yarn add @eclipse-laboratories-inc/eclipse-global-wallet
# or
pnpm add @eclipse-laboratories-inc/eclipse-global-wallet
```

***

#### ⚡ Quick Start

Import the registration module **once** during application startup. This makes the wallet discoverable to all wallet-standard compatible libraries (e.g. `@solana/wallet-adapter`).

**React (Vite)**

```ts
// src/main.tsx
import "@eclipse-laboratories-inc/eclipse-global-wallet/solana";

import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";

ReactDOM.createRoot(document.getElementById("root")!).render(<App />);
```

**Next.js (App Router or Pages)**

```tsx
// app/providers.tsx or pages/_app.tsx
"use client";
import "@eclipse-laboratories-inc/eclipse-global-wallet/solana";

export default function Providers({ children }: { children: React.ReactNode }) {
  return <>{children}</>;
}
```

***

#### 🔌 Add to Wallet Adapter Stack

If you're using `@solana/wallet-adapter`, simply register the wallet like so:

```ts
import { WalletProvider } from "@solana/wallet-adapter-react";
import { getEclipseWallet } from "@eclipse-laboratories-inc/eclipse-global-wallet/solana";

const wallets = [getEclipseWallet()];

<WalletProvider wallets={wallets} autoConnect>
  <YourApp />
</WalletProvider>;
```

***

#### 🌐 Use Eclipse RPC

When using `@solana/web3.js`, point to an Eclipse RPC endpoint:

```ts
import { Connection } from "@solana/web3.js";

const connection = new Connection("https://testnet.dev2.eclipsenetwork.xyz", "confirmed");
```

***

#### 🛠 Troubleshooting

* Ensure the package is installed:

  ```bash
  npm ls @eclipse-laboratories-inc/eclipse-global-wallet
  ```
* Update to the latest version:

  ```bash
  npm i @eclipse-laboratories-inc/eclipse-global-wallet@latest
  ```
* Double-check that you're importing the wallet registration file (`/solana`) at the top level of your app.
* Ensure you're using `wallet-standard` compatible libraries. If not, you'll need to manually wire the wallet into your stack using `getEclipseWallet()`.

***

#### 🔒 Security Notes

* All keys are generated client-side and remain in the user’s control.
* The wallet is powered by Dynamic, which supports passkey-based MFA and secure auth flows.
* No private keys are ever transmitted or stored server-side.

***

#### 📚 References

* [Solana Wallet Standard](https://github.com/solana-labs/wallet-standard)
* [Eclipse RPC Docs](https://docs.eclipse.xyz/developers/rpc-and-block-explorers)
* [NPM Package](https://www.npmjs.com/package/@eclipse-laboratories-inc/eclipse-global-wallet)
* [GitHub Repo](https://github.com/Eclipse-Laboratories-Inc/Eclipse-Global-Wallet)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.eclipse.xyz/developers/wallet/eclipse-global-wallet.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
