Skip to content

Commit 9ff7577

Browse files
committed
updates
1 parent 7a7815f commit 9ff7577

72 files changed

Lines changed: 3233 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- 'v*'
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: pnpm/action-setup@v4
15+
with:
16+
version: 9
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: 20
20+
cache: 'pnpm'
21+
- run: pnpm install --no-frozen-lockfile
22+
- run: pnpm typecheck
23+
- run: pnpm --filter @thanos/web build
24+
- run: pnpm --filter @thanos/extension build
25+
- run: pnpm --filter @thanos/mobile build
26+
- run: pnpm --filter @thanos/desktop dist

.github/workflows/sdk-cli-api.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: sdk-cli-api
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
validate:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: pnpm/action-setup@v4
14+
with:
15+
version: 9.12.0
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 20
19+
cache: pnpm
20+
- run: pnpm install --frozen-lockfile=false
21+
- run: pnpm typecheck
22+
- run: pnpm build

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules
2+
.next
3+
dist
4+
build
5+
coverage
6+
.env
7+
.env.local
8+
.DS_Store
9+
pnpm-lock.yaml
10+
out

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Wallet Platform Monorepo
2+
3+
Monorepo for a Lithosphere-first multi-platform wallet suite with publishable SDK packages, a CLI, and backend APIs.
4+
5+
## Included surfaces
6+
7+
- Platform API service
8+
- Indexer and LEP100 sync service
9+
- Shared SDK packages
10+
- CLI for operations and testing
11+
12+
## Repo layout
13+
14+
15+
- `apps/cli` - platform CLI
16+
- `packages/sdk-core` - core wallet SDK
17+
- `packages/sdk-api` - typed API client SDK
18+
- `packages/sdk-react` - React provider and hooks
19+
- `packages/ui` - shared UI library
20+
- `services/platform-api` - auth, contacts, drafts, DNNS, portfolio proxy, LEP100 sync trigger
21+
- `services/indexer` - portfolio, activity, LEP100 tokens, balances, approvals, and sync endpoints
22+
- `docs/` - architecture and integration docs
23+
24+
## Quick start
25+
26+
```bash
27+
pnpm install
28+
pnpm --filter @thanos/indexer dev
29+
pnpm --filter @thanos/platform-api dev
30+
pnpm --filter @thanos/cli dev -- health
31+
```
32+
33+
## Publishable packages
34+
35+
- `@thanos/sdk-core`
36+
- `@thanos/sdk-api`
37+
- `@thanos/cli`
38+
39+
## Primary platform capabilities
40+
41+
- BTC, SOL/SPL, EVM, and Lithosphere flows
42+
- LEP100 module and Makalu sync scaffolding
43+
- WalletConnect and DNNS layers
44+
- MultX and Ignite integration scaffolds
45+
- Ledger and Trezor integration scaffolds
46+
- Portfolio and activity API surfaces
47+
48+
## Important production note
49+
50+
This repository is production-oriented, but not yet fully audited. Before public launch, replace file-backed persistence with managed database-backed auth and authorization, complete the remaining hardware signing transports, validate final Lithic runtime RPC methods, and run external security review.

apps/cli/package.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "@thanos/cli",
3+
"version": "0.9.0",
4+
"type": "module",
5+
"bin": {
6+
"thanos": "dist/index.js"
7+
},
8+
"scripts": {
9+
"build": "tsc -p tsconfig.json && chmod +x dist/index.js",
10+
"dev": "tsx src/index.ts",
11+
"typecheck": "tsc -p tsconfig.json --noEmit",
12+
"lint": "echo 'no lint configured'",
13+
"test": "node -e \"console.log('no tests configured')\""
14+
},
15+
"dependencies": {
16+
"@thanos/sdk-api": "workspace:*",
17+
"@thanos/sdk-core": "workspace:*",
18+
"commander": "^12.1.0"
19+
},
20+
"devDependencies": {
21+
"tsx": "^4.19.2",
22+
"typescript": "^5.6.3"
23+
}
24+
}

apps/cli/src/index.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env node
2+
import { Command } from 'commander';
3+
import { PlatformApiClient } from '@thanos/sdk-api';
4+
import { WalletEngine } from '@thanos/sdk-core';
5+
6+
const program = new Command();
7+
program.name('thanos').description('CLI for wallet platform operations').version('0.9.0');
8+
9+
program.option('--api <url>', 'Platform API base URL', process.env.THANOS_API_URL || 'http://localhost:4020');
10+
11+
program.command('health').action(async () => {
12+
const api = new PlatformApiClient({ baseUrl: program.opts().api });
13+
console.log(JSON.stringify(await api.health(), null, 2));
14+
});
15+
16+
program.command('wallet:create').description('Create a new local wallet in memory').action(async () => {
17+
const engine = new WalletEngine();
18+
const state = await engine.createWallet();
19+
console.log(JSON.stringify({ mnemonic: state.mnemonic, accounts: state.accounts }, null, 2));
20+
});
21+
22+
program.command('portfolio <address>').action(async (address: string) => {
23+
const api = new PlatformApiClient({ baseUrl: program.opts().api });
24+
console.log(JSON.stringify(await api.portfolio(address), null, 2));
25+
});
26+
27+
program.command('lep100:tokens').option('--chain-id <id>', 'Chain id', '700777').action(async (opts: { chainId: string }) => {
28+
const api = new PlatformApiClient({ baseUrl: program.opts().api });
29+
console.log(JSON.stringify(await api.lep100Tokens(Number(opts.chainId)), null, 2));
30+
});
31+
32+
program.command('lep100:balances <address>').action(async (address: string) => {
33+
const api = new PlatformApiClient({ baseUrl: program.opts().api });
34+
console.log(JSON.stringify(await api.lep100Balances(address), null, 2));
35+
});
36+
37+
program.command('lep100:sync').option('--mode <mode>', 'bootstrap|incremental|backfill', 'incremental').action(async (opts: { mode: 'bootstrap' | 'incremental' | 'backfill' }) => {
38+
const api = new PlatformApiClient({ baseUrl: program.opts().api });
39+
console.log(JSON.stringify(await api.lep100Sync(opts.mode), null, 2));
40+
});
41+
42+
program.command('dnns:resolve <name>').action(async (name: string) => {
43+
const api = new PlatformApiClient({ baseUrl: program.opts().api });
44+
console.log(JSON.stringify(await api.dnnsResolve(name), null, 2));
45+
});
46+
47+
program.parseAsync(process.argv);

apps/cli/tsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"outDir": "dist",
5+
"rootDir": "src"
6+
},
7+
"include": ["src/**/*"]
8+
}

docs/architecture.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Thanos Wallet Architecture
2+
3+
## Surfaces
4+
5+
- Web app
6+
- Browser extension for Chrome and Brave
7+
- Safari Web Extension conversion target
8+
- Mobile app for iOS and Android
9+
- Desktop app for macOS and Windows
10+
11+
## Shared SDK
12+
13+
All clients consume `@thanos/sdk-core`, which centralizes:
14+
15+
- Lithosphere network defaults for Makalu and Kamet
16+
- Token registry including LITHO, COLLE, AGII, ATUA, IMAGEN, BTC, SOL, and SPL defaults
17+
- Wallet lifecycle and account derivation
18+
- EVM, Lithic, Bitcoin, and Solana clients
19+
- MultX swap and bridge adapters
20+
- Ignite DEX deeplink launcher
21+
- Ledger and Trezor connectors
22+
- Transaction simulation and anti-phishing modules
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { PlatformApiClient } from '@thanos/sdk-api';
2+
3+
async function main() {
4+
const api = new PlatformApiClient({ baseUrl: process.env.THANOS_API_URL || 'http://localhost:4020' });
5+
const session = await api.register({
6+
email: 'builder@example.com',
7+
password: 'change-me-please',
8+
displayName: 'Builder'
9+
});
10+
api.setAccessToken(session.accessToken);
11+
const portfolio = await api.portfolio('0x1111111111111111111111111111111111111111');
12+
console.log(portfolio);
13+
}
14+
15+
main().catch((error) => {
16+
console.error(error);
17+
process.exit(1);
18+
});

docs/lep100-module.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# LEP100 Module
2+
3+
## Overview
4+
5+
This branch adds first-class LEP100 support across the shared SDK, wallet engine, web UI, and indexer contract/event spec.
6+
7+
## Included in v7
8+
9+
- `Lep100Client` for metadata, balance, allowance, transfer, and approve flows
10+
- Verified Makalu token registry with `LITBTC2` explicitly excluded
11+
- Wallet engine helpers for LEP100 balance lookup and transfers
12+
- Web dashboard section for LEP100 balances and sends
13+
- Indexer spec endpoints describing event ingestion and storage
14+
15+
## Notes
16+
17+
The public Makalu token explorer page is dynamic. This branch ships a verified registry for the Makalu tokens already known in the repo and leaves the registry structured for adding more explorer-confirmed LEP100 contracts once the final contract addresses are available.

0 commit comments

Comments
 (0)