# devrox911/wallet-drainer-solana architecture

> Architecture diagram of the GitHub repository devrox911/wallet-drainer-solana, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/devrox911/wallet-drainer-solana
- Repository: https://github.com/devrox911/wallet-drainer-solana

## Overview

This TypeScript wallet-consolidation tool accepts a BS58 private key and destination, inventories SOL and SPL balances, prices assets, filters by a $5 threshold, reserves fees, then builds and submits one Solana transaction. The CLI provides wallet review and confirmation; the library API also exposes wallet information and transfer results. Source excerpts show the core orchestration and service calls; external price and Solana interactions are explicit in those excerpts.

Main entry points: [`src/moneyMover.ts`](https://github.com/devrox911/wallet-drainer-solana/blob/main/src/moneyMover.ts) (Transfer orchestrator), [`src/walletService.ts`](https://github.com/devrox911/wallet-drainer-solana/blob/main/src/walletService.ts) (Wallet service), [`src/index.ts`](https://github.com/devrox911/wallet-drainer-solana/blob/main/src/index.ts) (Interactive CLI), [`src/priceService.ts`](https://github.com/devrox911/wallet-drainer-solana/blob/main/src/priceService.ts) (Price service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry"]
  node_cli["Interactive CLI<br/>[index.ts]"]
end

subgraph group_orchestration["Transfer workflow"]
  node_mover["Transfer orchestrator<br/>[moneyMover.ts]"]
  node_types["Transfer data types<br/>[types.ts]"]
end

subgraph group_services["Wallet and pricing"]
  node_wallet["Wallet service<br/>[walletService.ts]"]
  node_pricing["Price service<br/>[priceService.ts]"]
end

subgraph group_external["External systems"]
  node_solana{{"Solana RPC network"}}
  node_apis{{"Price APIs"}}
end

node_user(("Wallet operator"))

node_user -->|"provides inputs"| node_cli
node_cli -->|"requests transfer"| node_mover
node_cli -->|"requests wallet info"| node_mover
node_mover -->|"reads balances"| node_wallet
node_mover -->|"gets asset prices"| node_pricing
node_mover -->|"estimates fees"| node_wallet
node_mover -->|"builds transaction"| node_wallet
node_mover -->|"submits transaction"| node_wallet
node_wallet -->|"queries and submits"| node_solana
node_pricing -->|"fetches prices"| node_apis

click node_cli "https://github.com/devrox911/wallet-drainer-solana/blob/main/src/index.ts"
click node_mover "https://github.com/devrox911/wallet-drainer-solana/blob/main/src/moneyMover.ts"
click node_types "https://github.com/devrox911/wallet-drainer-solana/blob/main/src/types.ts"
click node_wallet "https://github.com/devrox911/wallet-drainer-solana/blob/main/src/walletService.ts"
click node_pricing "https://github.com/devrox911/wallet-drainer-solana/blob/main/src/priceService.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli toneBlue
class node_mover,node_types toneAmber
class node_wallet,node_pricing toneMint
class node_solana,node_apis toneRose
class node_user toneIndigo
```

## Components

### User entry

- [Interactive CLI](https://github.com/devrox911/wallet-drainer-solana/blob/main/src/index.ts): `src/index.ts`

### Transfer workflow

- [Transfer orchestrator](https://github.com/devrox911/wallet-drainer-solana/blob/main/src/moneyMover.ts): `src/moneyMover.ts`
- [Transfer data types](https://github.com/devrox911/wallet-drainer-solana/blob/main/src/types.ts): `src/types.ts`

### Wallet and pricing

- [Wallet service](https://github.com/devrox911/wallet-drainer-solana/blob/main/src/walletService.ts): `src/walletService.ts`
- [Price service](https://github.com/devrox911/wallet-drainer-solana/blob/main/src/priceService.ts): `src/priceService.ts`

### External systems

- **Solana RPC network**
- **Price APIs**

### Other components

- **Wallet operator**

## Connections

- Wallet operator → Interactive CLI: provides inputs (evidence: `src/index.ts`)
- Interactive CLI → Transfer orchestrator: requests transfer (evidence: `src/index.ts`)
- Interactive CLI → Transfer orchestrator: requests wallet info (evidence: `src/index.ts`)
- Transfer orchestrator → Wallet service: reads balances (evidence: `src/moneyMover.ts`)
- Transfer orchestrator → Price service: gets asset prices (evidence: `src/moneyMover.ts`)
- Transfer orchestrator → Wallet service: estimates fees (evidence: `src/moneyMover.ts`)
- Transfer orchestrator → Wallet service: builds transaction (evidence: `src/moneyMover.ts`)
- Transfer orchestrator → Wallet service: submits transaction (evidence: `src/moneyMover.ts`)
- Wallet service → Solana RPC network: queries and submits (evidence: `src/walletService.ts`)
- Price service → Price APIs: fetches prices (evidence: `src/priceService.ts`)
