Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 0 additions & 6 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
[build]
target-dir = "build-cache"

[target.x86_64-unknown-linux-gnu]
linker = "x86_64-unknown-linux-gnu-gcc"
# You might also need to specify AR and CC explicitly, though Cargo often infers CC from the linker.
# cc = "x86_64-unknown-linux-gnu-gcc"
# ar = "x86_64-unknown-linux-gnu-ar"

[dependencies.openssl-sys]
version = "0.9.109" # Use your actual version
features = ["vendored"]
14 changes: 8 additions & 6 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ program-keypair.json
**/*.so
build-cache
target
ui/node_modules
ui/.next
ui/out
ui/data
ui/logs
ui/src-tauri/target
apps/desktop/node_modules
apps/desktop/.next
apps/desktop/out
apps/desktop/data
apps/desktop/logs
apps/desktop/src-tauri/target
apps/mobile/.dart_tool
apps/mobile/build
*.log
47 changes: 43 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ jobs:
patchelf \
pkg-config

- name: Set up Node.js for embedded desktop assets
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 20.19.5
cache: npm
cache-dependency-path: apps/desktop/package-lock.json

- name: Build embedded desktop assets
working-directory: apps/desktop
run: |
npm ci
npm run build

- name: Check formatting
run: cargo fmt --all -- --check

Expand All @@ -53,7 +66,7 @@ jobs:
timeout-minutes: 30
defaults:
run:
working-directory: ui
working-directory: apps/desktop
steps:
- name: Check out repository
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
Expand All @@ -63,7 +76,7 @@ jobs:
with:
node-version: 20.19.5
cache: npm
cache-dependency-path: ui/package-lock.json
cache-dependency-path: apps/desktop/package-lock.json

- name: Install locked dependencies
run: |
Expand Down Expand Up @@ -92,14 +105,40 @@ jobs:
- name: Audit all Node dependencies
run: npm audit --audit-level=high

mobile:
name: Flutter mobile release gate
runs-on: ubuntu-24.04
timeout-minutes: 30
defaults:
run:
working-directory: apps/mobile
steps:
- name: Check out repository
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4

- name: Set up Flutter
uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e # v2
with:
channel: stable
cache: true

- name: Install Flutter dependencies
run: flutter pub get

- name: Analyze mobile app
run: flutter analyze

- name: Test mobile app
run: flutter test

container:
name: Linux container build
needs: [rust, frontend]
needs: [rust, frontend, mobile]
runs-on: ubuntu-24.04
timeout-minutes: 90
steps:
- name: Check out repository
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4

- name: Build deployment image
run: docker build --pull --tag sol-safekey-ui:ci .
run: docker build --pull --tag fnzero-safe:ci .
46 changes: 32 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ target
# Generated by cargo mutants
# Contains mutation testing data
**/mutants.out*/
sol-safekey
fnzero-safe
open-source
build-cache
keystore.json
/release/

# Local configuration and deployment signing material
.env
Expand All @@ -26,20 +27,37 @@ keystore.json
*-keypair.json
program-keypair.json

# Integrated web and desktop UI
/ui/node_modules/
# Desktop UI
/ui/.next/
/ui/.next-build/
/ui/out/
/ui/coverage/
/ui/data/
/ui/logs/
/ui/tmp/
/ui/.env*
/ui/.vercel/
/ui/next-env.d.ts
/ui/*.tsbuildinfo
/ui/*.pid
/apps/desktop/node_modules/
/apps/desktop/.next/
/apps/desktop/.next-build/
/apps/desktop/out/
/apps/desktop/coverage/
/apps/desktop/data/
/apps/desktop/logs/
/apps/desktop/tmp/
/apps/desktop/.env*
/apps/desktop/.vercel/
/apps/desktop/next-env.d.ts
/apps/desktop/*.tsbuildinfo
/apps/desktop/*.pid

# Flutter mobile UI
/apps/mobile/.dart_tool/
/apps/mobile/.flutter-plugins
/apps/mobile/.flutter-plugins-dependencies
/apps/mobile/build/
/apps/mobile/ios/Flutter/Generated.xcconfig
/apps/mobile/ios/Flutter/flutter_export_environment.sh
/apps/mobile/ios/Frameworks/
/apps/mobile/ios/Pods/
/apps/mobile/ios/.symlinks/
/apps/mobile/ios/Runner.xcworkspace/xcuserdata/
/apps/mobile/ios/Runner.xcodeproj/xcuserdata/
/apps/mobile/android/.gradle/
/apps/mobile/android/app/.cxx/
/apps/mobile/android/app/src/main/jniLibs/

# RustRover
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
Expand Down
26 changes: 13 additions & 13 deletions BOT_INTEGRATION.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Bot Integration Guide

Complete guide for integrating sol-safekey into your Solana trading bot or application.
Complete guide for integrating fnzero-safe into your Solana trading bot or application.

[中文文档](BOT_INTEGRATION_CN.md)

## Why Sol-SafeKey?
## Why FnzeroSafe?

Sol-SafeKey provides military-grade wallet security with simple integration - just 3 lines of code to add a complete interactive wallet management system to your bot.
FnzeroSafe provides military-grade wallet security with simple integration - just 3 lines of code to add a complete interactive wallet management system to your bot.

### Key Benefits

Expand All @@ -24,11 +24,11 @@ Add to your `Cargo.toml`:

```toml
[dependencies]
sol-safekey = { path = "../sol-safekey" }
fnzero-safe = { path = "../fnzero-safe" }

[features]
default = ["solana-ops"]
solana-ops = ["sol-safekey/solana-ops"]
solana-ops = ["fnzero-safe/solana-ops"]
```

### Step 2: Add Safekey Command
Expand All @@ -42,8 +42,8 @@ fn main() -> Result<()> {
// Check if running in safekey interactive mode
let args: Vec<String> = std::env::args().skip(1).collect();
if args.first().map(|s| s.as_str()) == Some("safekey") {
// Launch sol-safekey interactive menu
if let Err(e) = sol_safekey::interactive::show_main_menu() {
// Launch fnzero-safe interactive menu
if let Err(e) = fnzero_safe::interactive::show_main_menu() {
eprintln!("❌ {}", e);
std::process::exit(1);
}
Expand Down Expand Up @@ -97,7 +97,7 @@ This launches the full interactive menu with all wallet operations:

### Password Handling

Sol-SafeKey uses a secure password handling model:
FnzeroSafe uses a secure password handling model:

**✅ Secure Approach:**
- Password passed via stdin pipe
Expand Down Expand Up @@ -156,7 +156,7 @@ fi
### Loading Encrypted Wallet

```rust
use sol_safekey::KeyManager;
use fnzero_safe::KeyManager;
use std::io::{self, Read};

fn load_wallet() -> Result<solana_sdk::signature::Keypair> {
Expand All @@ -180,7 +180,7 @@ fn load_wallet() -> Result<solana_sdk::signature::Keypair> {
### Creating New Wallet

```rust
use sol_safekey::KeyManager;
use fnzero_safe::KeyManager;

fn create_wallet(password: &str) -> Result<()> {
// Generate new keypair
Expand All @@ -201,7 +201,7 @@ fn create_wallet(password: &str) -> Result<()> {
### Using Solana Operations

```rust
use sol_safekey::solana_ops::SolanaClient;
use fnzero_safe::solana_ops::SolanaClient;

fn bot_logic(keypair: &solana_sdk::signature::Keypair) -> Result<()> {
// Initialize Solana client
Expand Down Expand Up @@ -252,7 +252,7 @@ echo "your-password" | ./build-cache/release/examples/bot_example

## Key Features Summary

Sol-SafeKey provides comprehensive wallet management:
FnzeroSafe provides comprehensive wallet management:

| Feature | Support |
|---------|---------|
Expand Down Expand Up @@ -290,7 +290,7 @@ solana airdrop 2 YOUR_WALLET_ADDRESS --url devnet

### Integration Checklist

- [ ] Added sol-safekey dependency to Cargo.toml
- [ ] Added fnzero-safe dependency to Cargo.toml
- [ ] Added 3-line safekey command check to main()
- [ ] Created secure startup script with stdin password
- [ ] Tested wallet creation with safekey command
Expand Down
26 changes: 13 additions & 13 deletions BOT_INTEGRATION_CN.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Bot 集成指南

sol-safekey 集成到你的 Solana 交易机器人或应用程序的完整指南。
fnzero-safe 集成到你的 Solana 交易机器人或应用程序的完整指南。

[English Documentation](BOT_INTEGRATION.md)

## 为什么选择 Sol-SafeKey
## 为什么选择 FnzeroSafe

Sol-SafeKey 提供军事级钱包安全性和简单集成 - 只需 3 行代码即可为你的 bot 添加完整的交互式钱包管理系统。
FnzeroSafe 提供军事级钱包安全性和简单集成 - 只需 3 行代码即可为你的 bot 添加完整的交互式钱包管理系统。

### 核心优势

Expand All @@ -24,11 +24,11 @@ Sol-SafeKey 提供军事级钱包安全性和简单集成 - 只需 3 行代码

```toml
[dependencies]
sol-safekey = { path = "../sol-safekey" }
fnzero-safe = { path = "../fnzero-safe" }

[features]
default = ["solana-ops"]
solana-ops = ["sol-safekey/solana-ops"]
solana-ops = ["fnzero-safe/solana-ops"]
```

### 步骤 2: 添加 Safekey 命令
Expand All @@ -42,8 +42,8 @@ fn main() -> Result<()> {
// 检查是否运行在 safekey 交互模式
let args: Vec<String> = std::env::args().skip(1).collect();
if args.first().map(|s| s.as_str()) == Some("safekey") {
// 启动 sol-safekey 交互式菜单
if let Err(e) = sol_safekey::interactive::show_main_menu() {
// 启动 fnzero-safe 交互式菜单
if let Err(e) = fnzero_safe::interactive::show_main_menu() {
eprintln!("❌ {}", e);
std::process::exit(1);
}
Expand Down Expand Up @@ -97,7 +97,7 @@ cargo build --features solana-ops --release

### 密码处理

Sol-SafeKey 使用安全的密码处理模型:
FnzeroSafe 使用安全的密码处理模型:

**✅ 安全方式:**
- 密码通过 stdin 管道传递
Expand Down Expand Up @@ -156,7 +156,7 @@ fi
### 加载加密钱包

```rust
use sol_safekey::KeyManager;
use fnzero_safe::KeyManager;
use std::io::{self, Read};

fn load_wallet() -> Result<solana_sdk::signature::Keypair> {
Expand All @@ -180,7 +180,7 @@ fn load_wallet() -> Result<solana_sdk::signature::Keypair> {
### 创建新钱包

```rust
use sol_safekey::KeyManager;
use fnzero_safe::KeyManager;

fn create_wallet(password: &str) -> Result<()> {
// 生成新密钥对
Expand All @@ -201,7 +201,7 @@ fn create_wallet(password: &str) -> Result<()> {
### 使用 Solana 操作

```rust
use sol_safekey::solana_ops::SolanaClient;
use fnzero_safe::solana_ops::SolanaClient;

fn bot_logic(keypair: &solana_sdk::signature::Keypair) -> Result<()> {
// 初始化 Solana 客户端
Expand Down Expand Up @@ -252,7 +252,7 @@ echo "你的密码" | ./build-cache/release/examples/bot_example

## 核心功能总结

Sol-SafeKey 提供全面的钱包管理:
FnzeroSafe 提供全面的钱包管理:

| 功能 | 支持 |
|------|------|
Expand Down Expand Up @@ -290,7 +290,7 @@ solana airdrop 2 你的钱包地址 --url devnet

### 集成检查清单

- [ ] 在 Cargo.toml 中添加了 sol-safekey 依赖
- [ ] 在 Cargo.toml 中添加了 fnzero-safe 依赖
- [ ] 在 main() 中添加了 3 行 safekey 命令检查
- [ ] 创建了带 stdin 密码的安全启动脚本
- [ ] 通过 safekey 命令测试了钱包创建
Expand Down
Loading
Loading