Skip to content

Commit 7345513

Browse files
committed
merge: resolve conflict, keep both convenience exports + v6 token exports
Fixed additional compile error: ts-expect-error → ts-ignore for optional @solana/web3.js 155/155 tests passing
2 parents a9733ae + 91247d5 commit 7345513

28 files changed

Lines changed: 3661 additions & 71 deletions

.coderabbit.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
language: en-US
2+
reviews:
3+
profile: assertive
4+
request_changes_workflow: true
5+
high_level_summary: true
6+
poem: false
7+
auto_review:
8+
enabled: true
9+
drafts: false
10+
path_instructions:
11+
- path: "src/**/*.ts"
12+
instructions: |
13+
Non-custodial cryptocurrency wallet SDK. Review with extreme security focus:
14+
- Flag ANY exposure of private keys, mnemonics, or seed phrases in logs, errors, or return values
15+
- Flag unvalidated chain IDs, addresses, or transaction amounts
16+
- Flag missing spending policy validation before transaction signing
17+
- Flag reentrancy risks in contract interactions
18+
- Flag hardcoded RPC endpoints or API keys
19+
- Flag missing error handling on blockchain calls
20+
- path: "src/cli/**/*.ts"
21+
instructions: |
22+
AgentGuard CLI for transaction policy validation.
23+
- Flag private keys passed as CLI arguments (CRITICAL - CVE vector)
24+
- Flag missing input sanitization on CLI parameters
25+
- path: "**/*.sol"
26+
instructions: |
27+
Solidity smart contracts. Check for reentrancy, access control, unchecked calls, missing events.
28+
chat:
29+
auto_reply: true
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: AI Security Review
2+
on:
3+
pull_request:
4+
types: [opened, synchronize]
5+
branches: [main]
6+
paths: ['src/**/*.ts', 'src/**/*.sol', 'contracts/**/*.sol']
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
jobs:
11+
security-review:
12+
runs-on: ubuntu-latest
13+
name: Wallet Security Scan
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- name: Get changed files
19+
id: changed
20+
run: |
21+
FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}...${{ github.sha }} | grep -E '\.(ts|sol)$' | grep -v '\.d\.ts$' | grep -v 'test' | grep -v 'spec' | tr '\n' ' ')
22+
echo "files=$FILES" >> $GITHUB_OUTPUT
23+
- name: Security pattern scan
24+
if: steps.changed.outputs.files != ''
25+
run: |
26+
echo "## Security Scan Results" > /tmp/report.md
27+
FOUND=0
28+
for file in ${{ steps.changed.outputs.files }}; do
29+
[ ! -f "$file" ] && continue
30+
if grep -n -i 'console.*\(private\|secret\|mnemonic\|seed\)' "$file" 2>/dev/null; then
31+
echo "CRITICAL: Potential key exposure in $file" >> /tmp/report.md; FOUND=1
32+
fi
33+
if grep -n 'privateKey.*process\.argv\|--private-key\|--secret' "$file" 2>/dev/null; then
34+
echo "CRITICAL: Private key via CLI arg in $file" >> /tmp/report.md; FOUND=1
35+
fi
36+
if grep -n -E 'eval\s*\(|new\s+Function\s*\(' "$file" 2>/dev/null; then
37+
echo "HIGH: Dynamic code execution in $file" >> /tmp/report.md; FOUND=1
38+
fi
39+
done
40+
[ "$FOUND" -eq 0 ] && echo "No security patterns detected." >> /tmp/report.md
41+
cat /tmp/report.md
42+
- name: Post report
43+
if: always()
44+
uses: actions/github-script@v7
45+
with:
46+
script: |
47+
const fs = require('fs');
48+
let report = 'Security scan completed.';
49+
try { report = fs.readFileSync('/tmp/report.md', 'utf-8'); } catch(e) {}
50+
const hasCrit = report.includes('CRITICAL:');
51+
const icon = hasCrit ? '🔴' : '🟢';
52+
await github.rest.issues.createComment({
53+
owner: context.repo.owner, repo: context.repo.repo,
54+
issue_number: context.issue.number,
55+
body: '## ' + icon + ' Security Review\\n\\n' + report
56+
});
57+
if (hasCrit) core.setFailed('Critical security issues found');

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
## [6.0.0] — 2026-03-21
2+
3+
### Added
4+
- **`TokenRegistry` class** — 80+ verified token addresses across 11 EVM chains + Solana
5+
- Pre-populated registries: USDC, USDT, DAI, WETH, WBTC, LINK, UNI, AAVE, CRV, MKR, SNX, COMP, LDO, ARB, OP, and more
6+
- Native gas token support (ETH, POL, AVAX, S) with `isNative` flag
7+
- `addToken()` for custom token imports
8+
- Per-chain registry exports: `BASE_REGISTRY`, `ETHEREUM_REGISTRY`, `ARBITRUM_REGISTRY`, etc.
9+
- **Multi-token EVM transfers**: `sendToken()`, `sendNative()`, `getTokenBalance()`, `getNativeBalance()`, `getBalances()`
10+
- **Human-readable amount handling**: `toRaw()`, `toHuman()`, `formatBalance()`
11+
- **Solana SPL token support** (optional peer dependency `@solana/web3.js`):
12+
- `SolanaWallet` class with `getSolBalance()`, `sendSol()`, `sendSplToken()`, `getSplTokenBalance()`
13+
- **x402 multi-asset resolution** — payments now accept any token the server requests, not just USDC
14+
15+
### Changed
16+
- x402 client updated to resolve assets via `TokenRegistry` (multi-asset support)
17+
- Bumped version to 6.0.0
18+
19+
### Backward Compatible
20+
- All v5.x imports continue to work unchanged
21+
22+
---
23+
124
## [5.2.0] — 2026-03-16
225

326
### Added

0 commit comments

Comments
 (0)