LeoYeAI/agent-master-skills / skills/aawp
aawp
FlaggedAAWP (AI Agent Wallet Protocol) — the only crypto wallet protocol built exclusively for AI Agents on EVM-compatible blockchains. Not for humans. The signer is the AI Agent itself, cryptographically bound at wallet creation. Supports wallet lifecycle management, token transfers, DEX swaps, cross-chain bridging, arbitrary contract interactions, DCA automation, and price alerts.
| File | Kind | Size |
|---|---|---|
| README.md | markdown | 10.9 KB |
| SKILL.md | skill md | 20.1 KB |
| WALLET_SETUP.md | markdown | 4.6 KB |
| _meta.json | config | 436 B |
| bin/install.js | script | 7.0 KB |
| config/chains.json | config | 4.2 KB |
| core/index.d.ts | script | 2.8 KB |
| core/loader.js | script | 1.0 KB |
| daemon/client.js | script | 1.1 KB |
| daemon/daemon.js | script | 606 B |
| lib/address-book.js | script | 1.6 KB |
| lib/gas-estimator.js | script | 1.7 KB |
| lib/multicall.js | script | 2.6 KB |
| lib/nonce-manager.js | script | 1.9 KB |
| lib/tx-history.js | script | 1.3 KB |
| scripts/bootstrap.sh | script | 1.7 KB |
| scripts/dca.js | script | 9.4 KB |
| scripts/deploy-clanker.js | script | 13.6 KB |
| scripts/doctor.sh | script | 1.6 KB |
| scripts/ensure-daemon.sh | script | 2.2 KB |
| scripts/limit-order.js | script | 28.3 KB |
| scripts/nft.js | script | 25.2 KB |
| scripts/portfolio.js | script | 18.0 KB |
| scripts/price-alert.js | script | 12.1 KB |
| scripts/provision.sh | script | 9.4 KB |
| scripts/restart-daemon.sh | script | 1.5 KB |
| scripts/restore-impl.js | script | 3.9 KB |
| scripts/sign-worker.js | script | 2.9 KB |
| scripts/start-daemon.js | script | 3.9 KB |
| scripts/swap.js | script | 31.8 KB |
| scripts/wallet-manager.js | script | 70.6 KB |
| scripts/yield.js | script | 34.1 KB |
scripts/restore-impl.js
View on GitHub'use strict';
// Standalone restore — no native addon, safe to run when shards are missing
const path = require('path');
const fs = require('fs');
const { execSync } = require('child_process');
const C = process.env.AAWP_CONFIG || path.join(__dirname, '..', '.agent-config');
const S = process.env.AAWP_SKILL || path.resolve(__dirname, '..');
const backupPath = process.argv[3];
if (!backupPath) { console.log('Usage: wallet-manager restore <backup.tar.gz>'); process.exit(1); }
if (!fs.existsSync(backupPath)) { console.log('❌ Not found:', backupPath); process.exit(1); }
const tmpDir = `/tmp/aawp-restore-${Date.now()}`;
fs.mkdirSync(tmpDir, { recursive: true });
console.log('Extracting...');
execSync(`tar xzf "${backupPath}" -C "${tmpDir}"`, { stdio: 'inherit' });
// Detect backup format: v2 (portable) has manifest.json, v1 (legacy) has absolute paths
const manifestPath = path.join(tmpDir, 'manifest.json');
const isV2 = fs.existsSync(manifestPath);
const copyIfExists = (src, dst) => {
if (fs.existsSync(src)) {
fs.mkdirSync(path.dirname(dst), { recursive: true });
fs.copyFileSync(src, dst);
console.log(' ✅', path.basename(dst));
return true;
}
return false;
};
if (isV2) {
// ── V2 portable format ──
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
console.log(`Backup format: v${manifest.version} (${manifest.createdAt})`);
copyIfExists(path.join(tmpDir, 'agent-config/seed.enc'), path.join(C, 'seed.enc'));
copyIfExists(path.join(tmpDir, 'core/aawp-core.node'), path.join(S, 'core/aawp-core.node'));
copyIfExists(path.join(tmpDir, 'system/fonts.idx'), '/var/lib/aawp/.cache/fonts.idx');
copyIfExists(path.join(tmpDir, 'system/machine-id'), '/etc/machine-id');
copyIfExists(path.join(tmpDir, 'system/host.salt'), '/var/lib/aawp/host.salt');
copyIfExists(path.join(tmpDir, 'config/guardian.json'), path.join(S, 'config/guardian.json'));
// Restore any additional agent-config files
const acDir = path.join(tmpDir, 'agent-config');
if (fs.existsSync(acDir)) {
const walk = (dir, rel) => {
for (const e of fs.readdirSync(dir, { withFileTypes: true })) {
const full = path.join(dir, e.name);
const r = path.join(rel, e.name);
if (e.isDirectory()) walk(full, r);
else copyIfExists(full, path.join(C, r));
}
};
walk(acDir, '');
}
} else {
// ── V1 legacy format (absolute paths in tar) ──
console.log('Backup format: v1 (legacy absolute paths)');
const stripRoot = (abs) => path.join(tmpDir, abs);
copyIfExists(stripRoot(C + '/seed.enc'), path.join(C, 'seed.enc'));
copyIfExists(stripRoot(S + '/core/aawp-core.node'), path.join(S, 'core/aawp-core.node'));
copyIfExists(stripRoot('/var/lib/aawp/.cache/fonts.idx'), '/var/lib/aawp/.cache/fonts.idx');
copyIfExists(stripRoot('/etc/machine-id'), '/etc/machine-id');
copyIfExists(stripRoot('/var/lib/aawp/host.salt'), '/var/lib/aawp/host.salt');
copyIfExists(stripRoot(S + '/config/guardian.json'), path.join(S, 'config/guardian.json'));
// Try legacy .agent-config path from backup manifest
const backupCfg = stripRoot(C);
if (fs.existsSync(backupCfg)) {
execSync(`cp -r "${backupCfg}/." "${C}/"`, { stdio: 'inherit' });
console.log(' ✅ .agent-config dir restored');
}
}
// Regenerate binary hash
const corePath = path.join(S, 'core/aawp-core.node');
if (fs.existsSync(corePath)) {
const hash = execSync(`sha256sum "${corePath}" | cut -d' ' -f1`).toString().trim();
fs.writeFileSync(corePath + '.hash', hash);
console.log(` ✅ Hash regenerated: ${hash}`);
}
execSync(`rm -rf "${tmpDir}"`);
console.log('\n✅ Restore complete.');
console.log('\nNext steps:');
console.log(' 1. Restart daemon: bash scripts/restart-daemon.sh');
console.log(' 2. Verify status: node scripts/wallet-manager.js status\n');
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |