Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

sphere

> AI 编程
Open source

A Web3 wallet and agent platform for the Unicity network - crypto wallet, DMs, group chat, and marketplace.

9.8K stars0 likes2 views
WebsiteGitHub

About

A Web3 wallet and agent platform for the Unicity network - crypto wallet, DMs, group chat, and marketplace.

Unicity AgentSphere

A Web3 wallet and agent platform for the Unicity network — crypto wallet, DMs, group chat, and marketplace.

Features

Unicity state transitions:

  • Fast, low-cost token transfers
  • Token management and balance tracking
  • Incoming payment notifications
  • Nametag system (@username)

Common: QR codes, wallet switching, seed phrase management, real-time market data.

Connect Protocol (dApp ↔ Wallet)

Sphere implements ConnectHost — the wallet side of the Sphere Connect protocol. External dApps can connect to Sphere and request wallet operations:

  • Iframe mode — dApp embedded inside Sphere as an iframe connects via PostMessageTransport
  • Popup mode — dApp opens Sphere as a popup window, user approves the connection
  • Permission-based access — dApp requests specific scopes; user approves or rejects
  • Intent handling — dApp triggers send/sign/DM flows in the wallet UI

Key components: ConnectPage (/connect route), ConnectProvider, ConnectionApprovalModal.

Deep Links (unicity-connect://)

Sphere supports a custom URL protocol for inter-app linking within DMs. When a dApp sends a unicity-connect:// URL in a DM, Sphere renders it as an interactive button with two options: Open in Sphere (loads the URL as an iframe agent) or Open in browser (opens in a new tab).

Protocol format:

unicity-connect://host/path?query=params

When opened, the protocol is resolved to https:// (or http:// for localhost/127.0.0.1).

How it works:

  1. Sending — a dApp builds a URL and replaces https:// with unicity-connect:// before sending it as a DM message
  2. Rendering — Sphere's markdown parser detects unicity-connect:// in plain text, [text](unicity-connect://...), and <a href="unicity-connect://..."> formats, rendering a DeepLinkButton dropdown
  3. Opening in Sphere — a global handler (registered by useDeepLinkNavigation in DashboardLayout) navigates to /agents/custom?url=<httpsUrl>, loading the target as an iframe agent
  4. Opening in browser — the resolved http(s):// URL is opened in a new tab via window.open

Key files:

  • src/utils/deepLinkHandler.ts — protocol conversion (deepLinkToHttps), global click handler registry
  • src/utils/markdown.tsx — DeepLinkButton component, deep link detection in all link formats
  • src/hooks/useDeepLinkNavigation.ts — registers the Sphere-side navigation handler

Agent System

Agents are specialized interfaces loaded as tabs. Currently active:

  • Messages (DM) — private conversations via Nostr
  • Group Chat — public group channels via NIP-29
  • Sphere Agents — load any external dApp via iframe (custom URL)

Additional agent types can be added in src/config/activities.ts.

Group Chat (NIP-29)

Relay-based group messaging via NIP-29:

  • Public and private groups with invite codes
  • Real-time messaging via WebSocket
  • Group discovery, join/leave, unread tracking
  • Dedicated Zooid relay at wss://sphere-relay.unicity.network

Quick Start

Requirements

  • Node.js 20+

Setup

bash
npm install
cp .env.example .env    # Configure environment variables
npm run dev              # Start dev server at http://localhost:5173

Commands

bash
npm run dev          # Development server
npm run build        # TypeScript compile + Vite production build
npm run preview      # Preview production build
npm run lint         # ESLint
npm run test         # Vitest watch mode
npm run test:run     # Vitest single run

Environment Variables

Copy .env.example to .env. Key variables:

env
VITE_WELCOME_AGENT_NAMETAG=kbbot # Welcome DM agent nametag
VITE_WELCOME_DELAY_MS=4000       # Delay before welcome DM (ms)
SSL_CERT_PATH=                   # Dev server HTTPS (optional)
HMR_HOST=                        # Remote HMR host (optional)
BASE_PATH=/                      # Deployment base path

Tech Stack

  • React 19 + TypeScript, Vite 7
  • TanStack Query v5 — server state
  • Tailwind CSS 4 — styling
  • Framer Motion — animations
  • React Router DOM v7 — routing
  • @unicitylabs/sphere-sdk — all wallet operations (L3, Nostr, IPFS)
  • Vitest + jsdom — testing

Project Structure

…

Docker

bash
docker compose up        # Runs on port 3010

License

Private project — Unicity Labs

Issues· 50 open

View all issuesOpen on GitHub
  • #530

    Bridge assets in and out of Unicity from the wallet

    enhancementUpdated Sep 29, 2026
  • #525

    CDN 403s any query containing localhost/127.0.0.1, which blocks the documented custom-agent local-testing flow

    Updated Sep 17, 2026
  • #509

    No billing history: a paying user cannot see what they bought, when, or why their limits dropped

    enhancementUpdated Sep 8, 2026
  • #512

    Plan duration is a hardcoded 30-day constant the plan model cannot express

    bugUpdated Sep 7, 2026
  • #510

    Buying a cheaper plan silently discards the days already paid for

    bugmoney-safetyUpdated Sep 7, 2026
  • #508

    Cut the abandon/background-settlement machinery: a recovered key from a cancelled order has nowhere to land

    bugUpdated Sep 7, 2026
  • #497

    Mainnet rollout gate: four wallet-side defects to fix before MAINNET_ROLLOUT_ENABLED is flipped

    Updated Sep 3, 2026
  • #495

    Not rounded number in transaction history breaks formatting

    Updated Aug 31, 2026
  • #459

    Chat caches keyed on a nullable identity, and five surfaces that misreport a missing Sphere

    Updated Jul 26, 2026
  • #449

    [HIGH] Seed phrase is stored in plaintext in IndexedDB; there is no wallet password or unlock screen

    securitymainnet-blockerUpdated Jul 23, 2026

> Tags

TypeScriptai-agentswallet

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 29, 2026
CategoryAI 编程
PricingOpen source

> Related tools

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.