veillabs-cli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ANTIGRAVITY.md +135 -0
- package/README.md +15 -0
- package/dist/cli.js +103 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +123 -0
- package/package.json +44 -0
package/ANTIGRAVITY.md
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# Veil Labs SDK & CLI: Analysis and Design
|
|
2
|
+
|
|
3
|
+
This document provides a detailed blueprint for the **Veil Labs SDK** (TypeScript/JavaScript library) and the **Veil Labs CLI** (Command Line Interface). These tools are designed to provide developers and power users with seamless, private, and efficient access to the Veil Labs ecosystem.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Requirement Analysis & API Mapping
|
|
8
|
+
|
|
9
|
+
The Veil Labs SDK and CLI will interface with the following core API modules as defined in the [API Documentation](file:///Users/billlaxcode/Projects/Eki/veillabs/API_DOCUMENTATION.md).
|
|
10
|
+
|
|
11
|
+
### API to SDK/CLI Mapping Table
|
|
12
|
+
|
|
13
|
+
| Feature Area | API Endpoint | SDK Method | CLI Command |
|
|
14
|
+
| :--- | :--- | :--- | :--- |
|
|
15
|
+
| **Market Data** | `GET /api/currencies` | `client.market.getCurrencies()` | `veillabs market currencies` |
|
|
16
|
+
| | `GET /api/pairs/:t/:n` | `client.market.getPairs(ticker, net)` | `veillabs market pairs <t> <n>` |
|
|
17
|
+
| | `GET /api/estimates` | `client.market.getEstimate(params)` | `veillabs market estimate` |
|
|
18
|
+
| | `GET /api/ranges` | `client.market.getRanges(params)` | `veillabs market ranges` |
|
|
19
|
+
| **Private Swap** | `POST /api/exchanges` | `client.swap.create(params)` | `veillabs swap create` |
|
|
20
|
+
| | `GET /api/exchanges/:id` | `client.swap.getStatus(id)` | `veillabs swap status <id>` |
|
|
21
|
+
| **Private Seed** | `POST /api/seed/create` | `client.seed.create(params)` | `veillabs seed create` |
|
|
22
|
+
| | `GET /api/seed/status/:id` | `client.seed.getStatus(id)` | `veillabs seed status <id>` |
|
|
23
|
+
| **Proxy Transfer** | `POST /api/transfer` | `client.transfer.single(params)` | `veillabs transfer single` |
|
|
24
|
+
| | `POST /api/transfer/multi`| `client.transfer.multi(params)` | `veillabs transfer multi` |
|
|
25
|
+
| **Universal** | `GET /api/tracking/:id` | `client.track(id)` | `veillabs track <id>` |
|
|
26
|
+
| | `GET /api/volume` | `client.stats.getVolume()` | `veillabs stats volume` |
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 2. Veil Labs SDK Design (TypeScript)
|
|
31
|
+
|
|
32
|
+
The SDK will be built as a modular TypeScript library, ensuring type safety and ease of integration for both frontend and backend applications.
|
|
33
|
+
|
|
34
|
+
### Architecture Overview
|
|
35
|
+
- **Main Client Class**: `VeilLabsClient` – The entry point for all operations.
|
|
36
|
+
- **Namespaced Sub-clients**: `market`, `swap`, `seed`, `transfer`, `stats`.
|
|
37
|
+
- **Request Engine**: Uses `axios` or `fetch` with built-in retry logic and error handling.
|
|
38
|
+
- **Models/Types**: Standardized interfaces for request payloads and responses.
|
|
39
|
+
|
|
40
|
+
### SDK Usage Example
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
import { VeilLabsClient } from '@veillabs/sdk';
|
|
44
|
+
|
|
45
|
+
const client = new VeilLabsClient({
|
|
46
|
+
baseUrl: 'https://trade.veillabs.app/api', // Default
|
|
47
|
+
// No auth required for most endpoints
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// 1. Get Market Data
|
|
51
|
+
const currencies = await client.market.getCurrencies();
|
|
52
|
+
|
|
53
|
+
// 2. Create a Private Swap
|
|
54
|
+
const swap = await client.swap.create({
|
|
55
|
+
tickerFrom: 'eth',
|
|
56
|
+
networkFrom: 'eth',
|
|
57
|
+
tickerTo: 'btc',
|
|
58
|
+
networkTo: 'btc',
|
|
59
|
+
amount: '0.1',
|
|
60
|
+
addressTo: 'bc1q...',
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
console.log(`Tracking ID: ${swap.id}`);
|
|
64
|
+
|
|
65
|
+
// 3. Track Progress
|
|
66
|
+
const status = await client.track(swap.id);
|
|
67
|
+
console.log(`Current Status: ${status.status}`);
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## 3. VeilLabs CLI Design (Node.js)
|
|
73
|
+
|
|
74
|
+
The CLI will be a binary tool (`veillabs`) built using `commander.js` and `enquirer` for interactive prompts. It will favor privacy and streamline the "swap and forget" workflow.
|
|
75
|
+
|
|
76
|
+
### CLI Command Structure
|
|
77
|
+
|
|
78
|
+
> [!TIP]
|
|
79
|
+
> Use `--json` flag on any command to output raw JSON data for scripting.
|
|
80
|
+
|
|
81
|
+
#### Market Commands
|
|
82
|
+
- `veillabs market currencies`: List all supported tokens.
|
|
83
|
+
- `veillabs market estimate <from> <to> <amount>`: Quick rate check.
|
|
84
|
+
|
|
85
|
+
#### Transaction Commands
|
|
86
|
+
- `veillabs swap <from> <to> <amount> <address>`: Initiate a quick swap.
|
|
87
|
+
- `veillabs seed <from> <to> <amount>`: Starts an interactive wizard to configure multi-destination distribution.
|
|
88
|
+
- `veillabs track <id>`: Live-polls the status of a transaction with a progress bar.
|
|
89
|
+
|
|
90
|
+
#### Privacy/Proxy Commands
|
|
91
|
+
- `veillabs transfer <to> <amount> --network bsc --token bnb`: Obfuscated transfer.
|
|
92
|
+
- `veillabs transfer-multi`: Wizard-based multi-distribution for proxy transfers.
|
|
93
|
+
|
|
94
|
+
### CLI Interaction Mockup
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
$ veillabs swap eth btc 0.5 bc1q...
|
|
98
|
+
|
|
99
|
+
[VeilLabs] Initiating Private Swap: 0.5 ETH -> BTC
|
|
100
|
+
[VeilLabs] Internal Tracking ID: V31L-XM29-K8L1
|
|
101
|
+
[VeilLabs] Please deposit 0.5 ETH to: 0x9876...5432
|
|
102
|
+
|
|
103
|
+
Waiting for deposit... [████░░░░░░░░] 33% (Confirming)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## 4. Security & Privacy Guidelines
|
|
109
|
+
|
|
110
|
+
### Sensitive Data Handling
|
|
111
|
+
> [!WARNING]
|
|
112
|
+
> The `Proxy Transfer` feature requires a `privateKey`.
|
|
113
|
+
> - **SDK Users**: Ensure `privateKey` is handled via environment variables and never hardcoded or logged.
|
|
114
|
+
> - **CLI Users**: Use the `--prompt-key` flag to enter the private key securely without it appearing in command history.
|
|
115
|
+
|
|
116
|
+
### Privacy Integration
|
|
117
|
+
- **Zero Storage**: The CLI should clear its local cache (if any) after a transaction reaches a terminal state (`finished` or `failed`).
|
|
118
|
+
- **Endpoint Privacy**: All SDK requests will be designed to mask user metadata (e.g., custom headers) when communicating with the VeilLabs API.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## 5. Development Roadmap
|
|
123
|
+
|
|
124
|
+
1. **Phase 1 (Core SDK)**: Build the base `VeilLabsClient` and Market/Swap modules.
|
|
125
|
+
2. **Phase 2 (CLI Foundation)**: Implement core CLI commands (`currencies`, `swap`, `track`).
|
|
126
|
+
3. **Phase 3 (Advanced Features)**: Add Private Seed and Proxy Transfer support to both SDK and CLI.
|
|
127
|
+
4. **Phase 4 (Packaging)**: NPM publication (`@veillabs/sdk`) and binary distribution.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## 6. Analysis Summary
|
|
132
|
+
|
|
133
|
+
The current VeilLabs API is well-structured and follows a clean RESTful pattern, making it highly suitable for SDK/CLI abstraction. The separation of **Intake** (Swap/Seed) and **Execution** (Status/Tracking) allows the CLI to provide a high-quality "Live Dashboard" experience even in a terminal environment.
|
|
134
|
+
|
|
135
|
+
Implementing these tools will significantly lower the barrier for developers building on VeilLabs and provide power users with an alternative to the web UI.
|
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# veillabs-cli
|
|
2
|
+
|
|
3
|
+
To install dependencies:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
bun install
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
To run:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
bun run index.ts
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
This project was created using `bun init` in bun v1.3.10. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
|