@pocketagent/paw 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/LICENSE +21 -0
- package/README.md +307 -0
- package/dist/cli/commands/address.d.ts +3 -0
- package/dist/cli/commands/address.d.ts.map +1 -0
- package/dist/cli/commands/address.js +32 -0
- package/dist/cli/commands/address.js.map +1 -0
- package/dist/cli/commands/balance.d.ts +3 -0
- package/dist/cli/commands/balance.d.ts.map +1 -0
- package/dist/cli/commands/balance.js +76 -0
- package/dist/cli/commands/balance.js.map +1 -0
- package/dist/cli/commands/config.d.ts +3 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/config.js +90 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/dashboard.d.ts +3 -0
- package/dist/cli/commands/dashboard.d.ts.map +1 -0
- package/dist/cli/commands/dashboard.js +224 -0
- package/dist/cli/commands/dashboard.js.map +1 -0
- package/dist/cli/commands/history.d.ts +3 -0
- package/dist/cli/commands/history.d.ts.map +1 -0
- package/dist/cli/commands/history.js +103 -0
- package/dist/cli/commands/history.js.map +1 -0
- package/dist/cli/commands/init.d.ts +3 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +62 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/send.d.ts +3 -0
- package/dist/cli/commands/send.d.ts.map +1 -0
- package/dist/cli/commands/send.js +65 -0
- package/dist/cli/commands/send.js.map +1 -0
- package/dist/cli/commands/swap.d.ts +3 -0
- package/dist/cli/commands/swap.d.ts.map +1 -0
- package/dist/cli/commands/swap.js +123 -0
- package/dist/cli/commands/swap.js.map +1 -0
- package/dist/cli/commands/tokens.d.ts +3 -0
- package/dist/cli/commands/tokens.d.ts.map +1 -0
- package/dist/cli/commands/tokens.js +97 -0
- package/dist/cli/commands/tokens.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +31 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/crypto/machine-identity.d.ts +26 -0
- package/dist/core/crypto/machine-identity.d.ts.map +1 -0
- package/dist/core/crypto/machine-identity.js +87 -0
- package/dist/core/crypto/machine-identity.js.map +1 -0
- package/dist/core/signer/engine.d.ts +17 -0
- package/dist/core/signer/engine.d.ts.map +1 -0
- package/dist/core/signer/engine.js +81 -0
- package/dist/core/signer/engine.js.map +1 -0
- package/dist/core/storage/encryption.d.ts +23 -0
- package/dist/core/storage/encryption.d.ts.map +1 -0
- package/dist/core/storage/encryption.js +79 -0
- package/dist/core/storage/encryption.js.map +1 -0
- package/dist/core/storage/filesystem.d.ts +68 -0
- package/dist/core/storage/filesystem.d.ts.map +1 -0
- package/dist/core/storage/filesystem.js +189 -0
- package/dist/core/storage/filesystem.js.map +1 -0
- package/dist/core/wallet/manager.d.ts +30 -0
- package/dist/core/wallet/manager.d.ts.map +1 -0
- package/dist/core/wallet/manager.js +98 -0
- package/dist/core/wallet/manager.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/jupiter/client.d.ts +62 -0
- package/dist/integrations/jupiter/client.d.ts.map +1 -0
- package/dist/integrations/jupiter/client.js +143 -0
- package/dist/integrations/jupiter/client.js.map +1 -0
- package/dist/types/transaction.d.ts +23 -0
- package/dist/types/transaction.d.ts.map +1 -0
- package/dist/types/transaction.js +3 -0
- package/dist/types/transaction.js.map +1 -0
- package/dist/types/wallet.d.ts +31 -0
- package/dist/types/wallet.d.ts.map +1 -0
- package/dist/types/wallet.js +3 -0
- package/dist/types/wallet.js.map +1 -0
- package/dist/utils/price.d.ts +12 -0
- package/dist/utils/price.d.ts.map +1 -0
- package/dist/utils/price.js +45 -0
- package/dist/utils/price.js.map +1 -0
- package/dist/utils/solana.d.ts +22 -0
- package/dist/utils/solana.d.ts.map +1 -0
- package/dist/utils/solana.js +85 -0
- package/dist/utils/solana.js.map +1 -0
- package/package.json +80 -0
- package/skills/SKILLS.md +393 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.swapCommand = void 0;
|
|
37
|
+
const commander_1 = require("commander");
|
|
38
|
+
const manager_1 = require("../../core/wallet/manager");
|
|
39
|
+
const client_1 = require("../../integrations/jupiter/client");
|
|
40
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
41
|
+
exports.swapCommand = new commander_1.Command('swap')
|
|
42
|
+
.description('📟 Swap tokens using Jupiter DEX')
|
|
43
|
+
.requiredOption('--agent-id <id>', 'Agent identifier')
|
|
44
|
+
.requiredOption('--from <token>', 'Input token (SOL, USDC, USDT, BONK or mint address)')
|
|
45
|
+
.requiredOption('--to <token>', 'Output token (SOL, USDC, USDT, BONK or mint address)')
|
|
46
|
+
.requiredOption('--amount <amount>', 'Amount to swap')
|
|
47
|
+
.option('--network <network>', 'Network to use (devnet, mainnet-beta)', 'mainnet-beta')
|
|
48
|
+
.option('--slippage <bps>', 'Slippage tolerance in basis points (default: 50, meme coins: 500-1000)', '50')
|
|
49
|
+
.option('--priority-fee <lamports>', 'Priority fee in lamports for faster execution (default: auto)')
|
|
50
|
+
.action(async (options) => {
|
|
51
|
+
try {
|
|
52
|
+
// Load config to get defaults
|
|
53
|
+
const { FileSystemStorage } = await Promise.resolve().then(() => __importStar(require('../../core/storage/filesystem')));
|
|
54
|
+
const config = await FileSystemStorage.loadConfig(options.agentId);
|
|
55
|
+
// Use config defaults if not specified
|
|
56
|
+
const slippage = options.slippage || config.defaultSlippage || 50;
|
|
57
|
+
const priorityFee = options.priorityFee || config.defaultPriorityFee;
|
|
58
|
+
console.log('\n📟 PAW - Token Swap');
|
|
59
|
+
console.log('Agent ID:', options.agentId);
|
|
60
|
+
console.log('From: ', options.from);
|
|
61
|
+
console.log('To: ', options.to);
|
|
62
|
+
console.log('Amount: ', options.amount);
|
|
63
|
+
console.log('Network: ', options.network);
|
|
64
|
+
// Jupiter only works on mainnet
|
|
65
|
+
if (options.network !== 'mainnet-beta') {
|
|
66
|
+
console.log('\n⚠️ Warning: Jupiter only works on mainnet-beta');
|
|
67
|
+
console.log('Switching to mainnet-beta...');
|
|
68
|
+
options.network = 'mainnet-beta';
|
|
69
|
+
}
|
|
70
|
+
// Resolve token addresses
|
|
71
|
+
const inputMint = client_1.JupiterClient.TOKENS[options.from] || options.from;
|
|
72
|
+
const outputMint = client_1.JupiterClient.TOKENS[options.to] || options.to;
|
|
73
|
+
// Convert amount to smallest unit
|
|
74
|
+
let amount;
|
|
75
|
+
if (options.from === 'SOL') {
|
|
76
|
+
amount = Math.floor(parseFloat(options.amount) * web3_js_1.LAMPORTS_PER_SOL);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
// For other tokens, assume 6 decimals (USDC/USDT standard)
|
|
80
|
+
amount = Math.floor(parseFloat(options.amount) * 1e6);
|
|
81
|
+
}
|
|
82
|
+
console.log('\nFetching quote from Jupiter...');
|
|
83
|
+
// Load keypair first to get public key
|
|
84
|
+
const keypair = await manager_1.WalletManager.loadKeypairAuto(options.agentId);
|
|
85
|
+
// Load referral config if available
|
|
86
|
+
const referralConfig = client_1.JupiterClient.loadReferralConfig();
|
|
87
|
+
const quote = await client_1.JupiterClient.getQuote(inputMint, outputMint, amount, parseInt(slippage.toString()), {
|
|
88
|
+
userPublicKey: keypair.publicKey.toBase58(),
|
|
89
|
+
referralAccount: referralConfig?.referralAccount,
|
|
90
|
+
referralFee: referralConfig?.referralFee,
|
|
91
|
+
});
|
|
92
|
+
// Display quote
|
|
93
|
+
const outAmount = options.to === 'SOL'
|
|
94
|
+
? (parseInt(quote.outAmount) / web3_js_1.LAMPORTS_PER_SOL).toFixed(6)
|
|
95
|
+
: (parseInt(quote.outAmount) / 1e6).toFixed(6);
|
|
96
|
+
console.log('\n📊 Quote:');
|
|
97
|
+
console.log('Input: ', options.amount, options.from);
|
|
98
|
+
console.log('Output: ', outAmount, options.to);
|
|
99
|
+
console.log('Price Impact:', quote.priceImpactPct, '%');
|
|
100
|
+
console.log('Slippage:', slippage, 'bps', `(${(parseInt(slippage.toString()) / 100).toFixed(1)}%)`);
|
|
101
|
+
if (priorityFee) {
|
|
102
|
+
console.log('Priority Fee:', priorityFee, 'lamports');
|
|
103
|
+
}
|
|
104
|
+
// Execute swap using Ultra API
|
|
105
|
+
console.log('\nExecuting swap...');
|
|
106
|
+
const result = await client_1.JupiterClient.executeSwap(quote, keypair);
|
|
107
|
+
if (result.status === 'Success') {
|
|
108
|
+
console.log('\n✅ Swap completed!');
|
|
109
|
+
console.log('Signature:', result.signature);
|
|
110
|
+
console.log('Explorer: https://explorer.solana.com/tx/' + result.signature);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
console.log('\n❌ Swap failed');
|
|
114
|
+
console.log('Details:', result);
|
|
115
|
+
}
|
|
116
|
+
console.log('');
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
console.error('\n❌ Error:', error.message);
|
|
120
|
+
process.exit(1);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
//# sourceMappingURL=swap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swap.js","sourceRoot":"","sources":["../../../src/cli/commands/swap.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAoC;AACpC,uDAA0D;AAE1D,8DAAkE;AAClE,6CAA4D;AAE/C,QAAA,WAAW,GAAG,IAAI,mBAAO,CAAC,MAAM,CAAC;KAC3C,WAAW,CAAC,kCAAkC,CAAC;KAC/C,cAAc,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;KACrD,cAAc,CAAC,gBAAgB,EAAE,qDAAqD,CAAC;KACvF,cAAc,CAAC,cAAc,EAAE,sDAAsD,CAAC;KACtF,cAAc,CAAC,mBAAmB,EAAE,gBAAgB,CAAC;KACrD,MAAM,CAAC,qBAAqB,EAAE,uCAAuC,EAAE,cAAc,CAAC;KACtF,MAAM,CAAC,kBAAkB,EAAE,wEAAwE,EAAE,IAAI,CAAC;KAC1G,MAAM,CAAC,2BA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AC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,YAAY,EAAG,KAAe,CAAC,OAAO,CAAC,CAAC;QACtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,eAAO,MAAM,aAAa,SAoGtB,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.tokensCommand = void 0;
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const manager_1 = require("../../core/wallet/manager");
|
|
9
|
+
const solana_1 = require("../../utils/solana");
|
|
10
|
+
const filesystem_1 = require("../../core/storage/filesystem");
|
|
11
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
12
|
+
const cli_table3_1 = __importDefault(require("cli-table3"));
|
|
13
|
+
exports.tokensCommand = new commander_1.Command('tokens')
|
|
14
|
+
.description('📟 List all tokens in wallet')
|
|
15
|
+
.argument('[agent-id]', 'Agent identifier')
|
|
16
|
+
.option('--agent-id <id>', 'Agent identifier (alternative)')
|
|
17
|
+
.option('--network <network>', 'Network to use (overrides config)')
|
|
18
|
+
.action(async (agentIdArg, options) => {
|
|
19
|
+
try {
|
|
20
|
+
// Support both positional and flag syntax
|
|
21
|
+
const agentId = agentIdArg || options.agentId;
|
|
22
|
+
if (!agentId) {
|
|
23
|
+
console.error('\n❌ Error: Agent ID is required');
|
|
24
|
+
console.log('\nUsage: paw tokens <agent-id>');
|
|
25
|
+
console.log(' or: paw tokens --agent-id <agent-id>');
|
|
26
|
+
console.log('');
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
// Use network from options or fall back to config
|
|
30
|
+
let network = options.network;
|
|
31
|
+
if (!network) {
|
|
32
|
+
const config = await filesystem_1.FileSystemStorage.loadConfig(agentId);
|
|
33
|
+
network = config.network || 'mainnet-beta';
|
|
34
|
+
}
|
|
35
|
+
console.log('\n📟 PAW - Token Balances');
|
|
36
|
+
console.log('Agent ID:', agentId);
|
|
37
|
+
console.log('Network: ', network);
|
|
38
|
+
console.log('');
|
|
39
|
+
const walletInfo = await manager_1.WalletManager.getWalletInfo(agentId);
|
|
40
|
+
const connection = solana_1.SolanaClient.getConnection(network);
|
|
41
|
+
const publicKey = new web3_js_1.PublicKey(walletInfo.address);
|
|
42
|
+
// Get SOL balance
|
|
43
|
+
const solBalance = await connection.getBalance(publicKey);
|
|
44
|
+
const solBalanceFormatted = (solBalance / 1e9).toFixed(9);
|
|
45
|
+
// Get SPL token accounts
|
|
46
|
+
const tokenAccounts = await connection.getParsedTokenAccountsByOwner(publicKey, { programId: new web3_js_1.PublicKey('TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA') });
|
|
47
|
+
// Create table
|
|
48
|
+
const table = new cli_table3_1.default({
|
|
49
|
+
head: ['Token', 'Symbol', 'Balance', 'Decimals', 'Mint Address'],
|
|
50
|
+
colWidths: [15, 10, 20, 10, 25],
|
|
51
|
+
style: {
|
|
52
|
+
head: ['cyan'],
|
|
53
|
+
border: ['gray'],
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
// Add SOL first
|
|
57
|
+
table.push(['Solana', 'SOL', solBalanceFormatted, '9', 'Native']);
|
|
58
|
+
// Add SPL tokens
|
|
59
|
+
if (tokenAccounts.value.length === 0) {
|
|
60
|
+
console.log('SOL Balance:', solBalanceFormatted, 'SOL');
|
|
61
|
+
console.log('\nNo SPL tokens found.');
|
|
62
|
+
console.log('');
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
for (const accountInfo of tokenAccounts.value) {
|
|
66
|
+
const parsedInfo = accountInfo.account.data.parsed.info;
|
|
67
|
+
const mint = parsedInfo.mint;
|
|
68
|
+
const balance = parsedInfo.tokenAmount.uiAmount || 0;
|
|
69
|
+
const decimals = parsedInfo.tokenAmount.decimals;
|
|
70
|
+
// Try to get token symbol (simplified - in production would use token list)
|
|
71
|
+
let symbol = 'Unknown';
|
|
72
|
+
let name = 'SPL Token';
|
|
73
|
+
// Common tokens
|
|
74
|
+
const knownTokens = {
|
|
75
|
+
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v': { name: 'USD Coin', symbol: 'USDC' },
|
|
76
|
+
'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB': { name: 'Tether USD', symbol: 'USDT' },
|
|
77
|
+
'DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263': { name: 'Bonk', symbol: 'BONK' },
|
|
78
|
+
'So11111111111111111111111111111111111111112': { name: 'Wrapped SOL', symbol: 'wSOL' },
|
|
79
|
+
};
|
|
80
|
+
if (knownTokens[mint]) {
|
|
81
|
+
name = knownTokens[mint].name;
|
|
82
|
+
symbol = knownTokens[mint].symbol;
|
|
83
|
+
}
|
|
84
|
+
const shortMint = `${mint.slice(0, 8)}...${mint.slice(-8)}`;
|
|
85
|
+
table.push([name, symbol, balance.toFixed(decimals), decimals.toString(), shortMint]);
|
|
86
|
+
}
|
|
87
|
+
console.log(table.toString());
|
|
88
|
+
console.log('');
|
|
89
|
+
console.log(`Total tokens: ${tokenAccounts.value.length + 1} (including SOL)`);
|
|
90
|
+
console.log('');
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
console.error('\n❌ Error:', error.message);
|
|
94
|
+
process.exit(1);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
//# sourceMappingURL=tokens.js.map
|
|
@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C,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5D,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC;QACxF,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,iBAAiB,aAAa,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAC/E,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,YAAY,EAAG,KAAe,CAAC,OAAO,CAAC,CAAC;QACtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const init_1 = require("./commands/init");
|
|
6
|
+
const balance_1 = require("./commands/balance");
|
|
7
|
+
const address_1 = require("./commands/address");
|
|
8
|
+
const send_1 = require("./commands/send");
|
|
9
|
+
const swap_1 = require("./commands/swap");
|
|
10
|
+
const history_1 = require("./commands/history");
|
|
11
|
+
const config_1 = require("./commands/config");
|
|
12
|
+
const tokens_1 = require("./commands/tokens");
|
|
13
|
+
const dashboard_1 = require("./commands/dashboard");
|
|
14
|
+
const program = new commander_1.Command();
|
|
15
|
+
program
|
|
16
|
+
.name('paw')
|
|
17
|
+
.description('📟 PocketAgent Wallet - Agentic wallet for AI agents on Solana')
|
|
18
|
+
.version('0.1.0');
|
|
19
|
+
// Register commands
|
|
20
|
+
program.addCommand(init_1.initCommand);
|
|
21
|
+
program.addCommand(dashboard_1.dashboardCommand);
|
|
22
|
+
program.addCommand(config_1.configCommand);
|
|
23
|
+
program.addCommand(address_1.addressCommand);
|
|
24
|
+
program.addCommand(balance_1.balanceCommand);
|
|
25
|
+
program.addCommand(tokens_1.tokensCommand);
|
|
26
|
+
program.addCommand(send_1.sendCommand);
|
|
27
|
+
program.addCommand(swap_1.swapCommand);
|
|
28
|
+
program.addCommand(history_1.historyCommand);
|
|
29
|
+
// Parse arguments
|
|
30
|
+
program.parse();
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,0CAA8C;AAC9C,gDAAoD;AACpD,gDAAoD;AACpD,0CAA8C;AAC9C,0CAA8C;AAC9C,gDAAoD;AACpD,8CAAkD;AAClD,8CAAkD;AAClD,oDAAwD;AAExD,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,KAAK,CAAC;KACX,WAAW,CAAC,gEAAgE,CAAC;KAC7E,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,oBAAoB;AACpB,OAAO,CAAC,UAAU,CAAC,kBAAW,CAAC,CAAC;AAChC,OAAO,CAAC,UAAU,CAAC,4BAAgB,CAAC,CAAC;AACrC,OAAO,CAAC,UAAU,CAAC,sBAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,wBAAc,CAAC,CAAC;AACnC,OAAO,CAAC,UAAU,CAAC,wBAAc,CAAC,CAAC;AACnC,OAAO,CAAC,UAAU,CAAC,sBAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,kBAAW,CAAC,CAAC;AAChC,OAAO,CAAC,UAAU,CAAC,kBAAW,CAAC,CAAC;AAChC,OAAO,CAAC,UAAU,CAAC,wBAAc,CAAC,CAAC;AAEnC,kBAAkB;AAClB,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate a unique key based on machine identity
|
|
3
|
+
* This key is consistent for the same machine but different across machines
|
|
4
|
+
*/
|
|
5
|
+
export declare class MachineIdentity {
|
|
6
|
+
/**
|
|
7
|
+
* Get a machine-specific encryption key
|
|
8
|
+
* Uses hostname, username, platform, and architecture
|
|
9
|
+
*/
|
|
10
|
+
static getMachineKey(): string;
|
|
11
|
+
/**
|
|
12
|
+
* Encrypt data with machine-specific key
|
|
13
|
+
* Data can only be decrypted on the same machine
|
|
14
|
+
*/
|
|
15
|
+
static encrypt(data: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Decrypt data with machine-specific key
|
|
18
|
+
* Only works on the same machine where it was encrypted
|
|
19
|
+
*/
|
|
20
|
+
static decrypt(encryptedData: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Check if data can be decrypted on this machine
|
|
23
|
+
*/
|
|
24
|
+
static canDecrypt(encryptedData: string): boolean;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=machine-identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"machine-identity.d.ts","sourceRoot":"","sources":["../../../src/core/crypto/machine-identity.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,qBAAa,eAAe;IAC1B;;;OAGG;IACH,MAAM,CAAC,aAAa,IAAI,MAAM;IAkB9B;;;OAGG;IACH,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAiBpC;;;OAGG;IACH,MAAM,CAAC,OAAO,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM;IAwB7C;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO;CAQlD"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MachineIdentity = void 0;
|
|
7
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
8
|
+
const os_1 = __importDefault(require("os"));
|
|
9
|
+
/**
|
|
10
|
+
* Generate a unique key based on machine identity
|
|
11
|
+
* This key is consistent for the same machine but different across machines
|
|
12
|
+
*/
|
|
13
|
+
class MachineIdentity {
|
|
14
|
+
/**
|
|
15
|
+
* Get a machine-specific encryption key
|
|
16
|
+
* Uses hostname, username, platform, and architecture
|
|
17
|
+
*/
|
|
18
|
+
static getMachineKey() {
|
|
19
|
+
// Combine machine-specific data
|
|
20
|
+
const machineData = [
|
|
21
|
+
os_1.default.hostname(), // Computer name
|
|
22
|
+
os_1.default.userInfo().username, // User name
|
|
23
|
+
os_1.default.platform(), // OS (darwin, linux, win32)
|
|
24
|
+
os_1.default.arch(), // CPU architecture (x64, arm64)
|
|
25
|
+
os_1.default.homedir(), // Home directory path
|
|
26
|
+
].join('|');
|
|
27
|
+
// Hash to create consistent 256-bit key
|
|
28
|
+
// This is unique per machine - no additional salt needed
|
|
29
|
+
return crypto_1.default
|
|
30
|
+
.createHash('sha256')
|
|
31
|
+
.update(machineData)
|
|
32
|
+
.digest('hex');
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Encrypt data with machine-specific key
|
|
36
|
+
* Data can only be decrypted on the same machine
|
|
37
|
+
*/
|
|
38
|
+
static encrypt(data) {
|
|
39
|
+
const machineKey = MachineIdentity.getMachineKey();
|
|
40
|
+
const algorithm = 'aes-256-cbc';
|
|
41
|
+
// Derive encryption key from machine key
|
|
42
|
+
const key = crypto_1.default.scryptSync(machineKey, 'salt', 32);
|
|
43
|
+
const iv = crypto_1.default.randomBytes(16);
|
|
44
|
+
// Encrypt
|
|
45
|
+
const cipher = crypto_1.default.createCipheriv(algorithm, key, iv);
|
|
46
|
+
let encrypted = cipher.update(data, 'utf8', 'hex');
|
|
47
|
+
encrypted += cipher.final('hex');
|
|
48
|
+
// Return IV + encrypted data (both needed for decryption)
|
|
49
|
+
return iv.toString('hex') + ':' + encrypted;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Decrypt data with machine-specific key
|
|
53
|
+
* Only works on the same machine where it was encrypted
|
|
54
|
+
*/
|
|
55
|
+
static decrypt(encryptedData) {
|
|
56
|
+
const machineKey = MachineIdentity.getMachineKey();
|
|
57
|
+
const algorithm = 'aes-256-cbc';
|
|
58
|
+
// Split IV and encrypted data
|
|
59
|
+
const parts = encryptedData.split(':');
|
|
60
|
+
if (parts.length !== 2) {
|
|
61
|
+
throw new Error('Invalid encrypted data format');
|
|
62
|
+
}
|
|
63
|
+
const iv = Buffer.from(parts[0], 'hex');
|
|
64
|
+
const encrypted = parts[1];
|
|
65
|
+
// Derive decryption key
|
|
66
|
+
const key = crypto_1.default.scryptSync(machineKey, 'salt', 32);
|
|
67
|
+
// Decrypt
|
|
68
|
+
const decipher = crypto_1.default.createDecipheriv(algorithm, key, iv);
|
|
69
|
+
let decrypted = decipher.update(encrypted, 'hex', 'utf8');
|
|
70
|
+
decrypted += decipher.final('utf8');
|
|
71
|
+
return decrypted;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Check if data can be decrypted on this machine
|
|
75
|
+
*/
|
|
76
|
+
static canDecrypt(encryptedData) {
|
|
77
|
+
try {
|
|
78
|
+
MachineIdentity.decrypt(encryptedData);
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.MachineIdentity = MachineIdentity;
|
|
87
|
+
//# sourceMappingURL=machine-identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"machine-identity.js","sourceRoot":"","sources":["../../../src/core/crypto/machine-identity.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,4CAAoB;AAEpB;;;GAGG;AACH,MAAa,eAAe;IAC1B;;;OAGG;IACH,MAAM,CAAC,aAAa;QAClB,gCAAgC;QAChC,MAAM,WAAW,GAAG;YAClB,YAAE,CAAC,QAAQ,EAAE,EAAY,gBAAgB;YACzC,YAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAG,YAAY;YACrC,YAAE,CAAC,QAAQ,EAAE,EAAY,4BAA4B;YACrD,YAAE,CAAC,IAAI,EAAE,EAAgB,gCAAgC;YACzD,YAAE,CAAC,OAAO,EAAE,EAAa,sBAAsB;SAChD,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAEZ,wCAAwC;QACxC,yDAAyD;QACzD,OAAO,gBAAM;aACV,UAAU,CAAC,QAAQ,CAAC;aACpB,MAAM,CAAC,WAAW,CAAC;aACnB,MAAM,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,OAAO,CAAC,IAAY;QACzB,MAAM,UAAU,GAAG,eAAe,CAAC,aAAa,EAAE,CAAC;QACnD,MAAM,SAAS,GAAG,aAAa,CAAC;QAEhC,yCAAyC;QACzC,MAAM,GAAG,GAAG,gBAAM,CAAC,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;QACtD,MAAM,EAAE,GAAG,gBAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QAElC,UAAU;QACV,MAAM,MAAM,GAAG,gBAAM,CAAC,cAAc,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QACzD,IAAI,SAAS,GAAG,MAAM,CAAC,MAAM,CAA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O,IAAI,CAAC;QACd,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF;AAnFD,0CAmFC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Transaction, Keypair, Connection } from '@solana/web3.js';
|
|
2
|
+
export declare class SignerEngine {
|
|
3
|
+
/**
|
|
4
|
+
* Sign a transaction with agent's keypair
|
|
5
|
+
* Keypair is decrypted in memory, used for signing, then immediately cleared
|
|
6
|
+
*/
|
|
7
|
+
static signTransaction(agentId: string, transaction: Transaction, passphrase: string): Promise<Transaction>;
|
|
8
|
+
/**
|
|
9
|
+
* Sign multiple transactions
|
|
10
|
+
*/
|
|
11
|
+
static signTransactions(agentId: string, transactions: Transaction[], passphrase: string): Promise<Transaction[]>;
|
|
12
|
+
/**
|
|
13
|
+
* Sign and send a transaction
|
|
14
|
+
*/
|
|
15
|
+
static signAndSend(transaction: Transaction, keypair: Keypair, connection: Connection): Promise<string>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../../src/core/signer/engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAInE,qBAAa,YAAY;IACvB;;;OAGG;WACU,eAAe,CAC1B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,WAAW,CAAC;IAyBvB;;OAEG;WACU,gBAAgB,CAC3B,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,WAAW,EAAE,EAC3B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,WAAW,EAAE,CAAC;IA0BzB;;OAEG;WACU,WAAW,CACtB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,GACrB,OAAO,CAAC,MAAM,CAAC;CAwBnB"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SignerEngine = void 0;
|
|
4
|
+
const manager_1 = require("../wallet/manager");
|
|
5
|
+
const encryption_1 = require("../storage/encryption");
|
|
6
|
+
class SignerEngine {
|
|
7
|
+
/**
|
|
8
|
+
* Sign a transaction with agent's keypair
|
|
9
|
+
* Keypair is decrypted in memory, used for signing, then immediately cleared
|
|
10
|
+
*/
|
|
11
|
+
static async signTransaction(agentId, transaction, passphrase) {
|
|
12
|
+
let keypair = null;
|
|
13
|
+
try {
|
|
14
|
+
// Load and decrypt keypair (exists only in memory)
|
|
15
|
+
keypair = await manager_1.WalletManager.loadKeypair(agentId, passphrase);
|
|
16
|
+
// Sign transaction
|
|
17
|
+
transaction.sign(keypair);
|
|
18
|
+
return transaction;
|
|
19
|
+
}
|
|
20
|
+
finally {
|
|
21
|
+
// CRITICAL: Clear keypair from memory
|
|
22
|
+
if (keypair) {
|
|
23
|
+
encryption_1.EncryptionService.clearKeypair(keypair);
|
|
24
|
+
keypair = null;
|
|
25
|
+
}
|
|
26
|
+
// Suggest garbage collection (not guaranteed but helps)
|
|
27
|
+
if (global.gc) {
|
|
28
|
+
global.gc();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Sign multiple transactions
|
|
34
|
+
*/
|
|
35
|
+
static async signTransactions(agentId, transactions, passphrase) {
|
|
36
|
+
let keypair = null;
|
|
37
|
+
try {
|
|
38
|
+
keypair = await manager_1.WalletManager.loadKeypair(agentId, passphrase);
|
|
39
|
+
// Sign all transactions
|
|
40
|
+
transactions.forEach((tx) => {
|
|
41
|
+
if (keypair) {
|
|
42
|
+
tx.sign(keypair);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
return transactions;
|
|
46
|
+
}
|
|
47
|
+
finally {
|
|
48
|
+
if (keypair) {
|
|
49
|
+
encryption_1.EncryptionService.clearKeypair(keypair);
|
|
50
|
+
keypair = null;
|
|
51
|
+
}
|
|
52
|
+
if (global.gc) {
|
|
53
|
+
global.gc();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Sign and send a transaction
|
|
59
|
+
*/
|
|
60
|
+
static async signAndSend(transaction, keypair, connection) {
|
|
61
|
+
try {
|
|
62
|
+
// Get recent blockhash
|
|
63
|
+
const { blockhash } = await connection.getLatestBlockhash();
|
|
64
|
+
transaction.recentBlockhash = blockhash;
|
|
65
|
+
transaction.feePayer = keypair.publicKey;
|
|
66
|
+
// Sign transaction
|
|
67
|
+
transaction.sign(keypair);
|
|
68
|
+
// Send transaction
|
|
69
|
+
const signature = await connection.sendRawTransaction(transaction.serialize());
|
|
70
|
+
// Confirm transaction
|
|
71
|
+
await connection.confirmTransaction(signature, 'confirmed');
|
|
72
|
+
return signature;
|
|
73
|
+
}
|
|
74
|
+
finally {
|
|
75
|
+
// Clear keypair from memory
|
|
76
|
+
encryption_1.EncryptionService.clearKeypair(keypair);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.SignerEngine = SignerEngine;
|
|
81
|
+
//# sourceMappingURL=engine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../../../src/core/signer/engine.ts"],"names":[],"mappings":";;;AACA,+CAAkD;AAClD,sDAA0D;AAE1D,MAAa,YAAY;IACvB;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,eAAe,CAC1B,OAAe,EACf,WAAwB,EACxB,UAAkB;QAElB,IAAI,OAAO,GAAmB,IAAI,CAAC;QAEnC,IAAI,CAAC;YACH,mDAAmD;YACnD,OAAO,GAAG,MAAM,uBAAa,CAAC,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;YA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AU,CAAC,kBAAkB,EAAE,CAAC;YAC5D,WAAW,CAAC,eAAe,GAAG,SAAS,CAAC;YACxC,WAAW,CAAC,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC;YAEzC,mBAAmB;YACnB,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAE1B,mBAAmB;YACnB,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,kBAAkB,CACnD,WAAW,CAAC,SAAS,EAAE,CACxB,CAAC;YAEF,sBAAsB;YACtB,MAAM,UAAU,CAAC,kBAAkB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;YAE5D,OAAO,SAAS,CAAC;QACnB,CAAC;gBAAS,CAAC;YACT,4BAA4B;YAC5B,8BAAiB,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC;CACF;AAlGD,oCAkGC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Keypair } from '@solana/web3.js';
|
|
2
|
+
import { EncryptedKeypair } from '../../types/wallet';
|
|
3
|
+
export declare class EncryptionService {
|
|
4
|
+
/**
|
|
5
|
+
* Generate a secure random passphrase
|
|
6
|
+
*/
|
|
7
|
+
static generatePassphrase(): string;
|
|
8
|
+
/**
|
|
9
|
+
* Encrypt a Solana keypair with a passphrase
|
|
10
|
+
* Uses AES-256-GCM with PBKDF2 key derivation
|
|
11
|
+
*/
|
|
12
|
+
static encrypt(keypair: Keypair, passphrase: string): EncryptedKeypair;
|
|
13
|
+
/**
|
|
14
|
+
* Decrypt an encrypted keypair
|
|
15
|
+
* Returns keypair that exists only in memory
|
|
16
|
+
*/
|
|
17
|
+
static decrypt(encryptedData: EncryptedKeypair, passphrase: string): Keypair;
|
|
18
|
+
/**
|
|
19
|
+
* Clear a keypair from memory (security best practice)
|
|
20
|
+
*/
|
|
21
|
+
static clearKeypair(keypair: Keypair): void;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=encryption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encryption.d.ts","sourceRoot":"","sources":["../../../src/core/storage/encryption.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAQtD,qBAAa,iBAAiB;IAC5B;;OAEG;IACH,MAAM,CAAC,kBAAkB,IAAI,MAAM;IAInC;;;OAGG;IACH,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,gBAAgB;IAsCtE;;;OAGG;IACH,MAAM,CAAC,OAAO,CACZ,aAAa,EAAE,gBAAgB,EAC/B,UAAU,EAAE,MAAM,GACjB,OAAO;IAiCV;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;CAG5C"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.EncryptionService = void 0;
|
|
7
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
8
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
9
|
+
const ALGORITHM = 'aes-256-gcm';
|
|
10
|
+
const KEY_LENGTH = 32;
|
|
11
|
+
const IV_LENGTH = 16;
|
|
12
|
+
const SALT_LENGTH = 32;
|
|
13
|
+
const ITERATIONS = 100000;
|
|
14
|
+
class EncryptionService {
|
|
15
|
+
/**
|
|
16
|
+
* Generate a secure random passphrase
|
|
17
|
+
*/
|
|
18
|
+
static generatePassphrase() {
|
|
19
|
+
return crypto_1.default.randomBytes(32).toString('base64');
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Encrypt a Solana keypair with a passphrase
|
|
23
|
+
* Uses AES-256-GCM with PBKDF2 key derivation
|
|
24
|
+
*/
|
|
25
|
+
static encrypt(keypair, passphrase) {
|
|
26
|
+
// Generate random salt and IV
|
|
27
|
+
const salt = crypto_1.default.randomBytes(SALT_LENGTH);
|
|
28
|
+
const iv = crypto_1.default.randomBytes(IV_LENGTH);
|
|
29
|
+
// Derive encryption key from passphrase
|
|
30
|
+
const key = crypto_1.default.pbkdf2Sync(passphrase, salt, ITERATIONS, KEY_LENGTH, 'sha256');
|
|
31
|
+
// Create cipher
|
|
32
|
+
const cipher = crypto_1.default.createCipheriv(ALGORITHM, key, iv);
|
|
33
|
+
// Encrypt the secret key
|
|
34
|
+
const secretKey = Buffer.from(keypair.secretKey);
|
|
35
|
+
const encrypted = Buffer.concat([
|
|
36
|
+
cipher.update(secretKey),
|
|
37
|
+
cipher.final(),
|
|
38
|
+
]);
|
|
39
|
+
// Get authentication tag
|
|
40
|
+
const authTag = cipher.getAuthTag();
|
|
41
|
+
// Clear sensitive data
|
|
42
|
+
secretKey.fill(0);
|
|
43
|
+
return {
|
|
44
|
+
salt,
|
|
45
|
+
iv,
|
|
46
|
+
encrypted,
|
|
47
|
+
authTag,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Decrypt an encrypted keypair
|
|
52
|
+
* Returns keypair that exists only in memory
|
|
53
|
+
*/
|
|
54
|
+
static decrypt(encryptedData, passphrase) {
|
|
55
|
+
// Derive key from passphrase
|
|
56
|
+
const key = crypto_1.default.pbkdf2Sync(passphrase, encryptedData.salt, ITERATIONS, KEY_LENGTH, 'sha256');
|
|
57
|
+
// Create decipher
|
|
58
|
+
const decipher = crypto_1.default.createDecipheriv(ALGORITHM, key, encryptedData.iv);
|
|
59
|
+
decipher.setAuthTag(encryptedData.authTag);
|
|
60
|
+
// Decrypt
|
|
61
|
+
const decrypted = Buffer.concat([
|
|
62
|
+
decipher.update(encryptedData.encrypted),
|
|
63
|
+
decipher.final(),
|
|
64
|
+
]);
|
|
65
|
+
// Create keypair from decrypted secret key
|
|
66
|
+
const keypair = web3_js_1.Keypair.fromSecretKey(new Uint8Array(decrypted));
|
|
67
|
+
// Clear decrypted buffer
|
|
68
|
+
decrypted.fill(0);
|
|
69
|
+
return keypair;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Clear a keypair from memory (security best practice)
|
|
73
|
+
*/
|
|
74
|
+
static clearKeypair(keypair) {
|
|
75
|
+
keypair.secretKey.fill(0);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.EncryptionService = EncryptionService;
|
|
79
|
+
//# sourceMappingURL=encryption.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encryption.js","sourceRoot":"","sources":["../../../src/core/storage/encryption.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,6CAA0C;AAG1C,MAAM,SAAS,GAAG,aAAa,CAAC;AAChC,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,SAAS,GAAG,EAAE,CAAC;AACrB,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB,MAAM,UAAU,GAAG,MAAM,CAAC;AAE1B,MAAa,iBAAiB;IAC5B;;OAEG;IACH,MAAM,CAAC,kBAAkB;QACvB,OAAO,gBAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACnD,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,OAAO,CAAC,OAAgB,EAAE,UAAkB;QACjD,8BAA8B;QAC9B,MAAM,IAAI,GAAG,gBAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAC7C,MAAM,EAAE,GAAG,gBAAM,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAEzC,wCAAwC;QACxC,MAAM,GAAG,GAAG,gBAAM,CAAC,UAAU,CAC3B,UAAU,EACV,IAAI,EACJ,UAAU,EACV,UAAU,EACV,QAAQ,CACT,CAAC;QA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