Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ dist/
.env.local
.env.*.local

sentinel.config.yaml

# IDE files
.vscode/
.idea/
Expand Down
30 changes: 30 additions & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Gitleaks custom configuration for blockchain projects
title = "Gitleaks config for eco-routes-cli"

[extend]
# Extend the default gitleaks config
useDefault = true

[[rules]]
id = "ethereum-private-key"
description = "Ethereum/EVM Private Key (64 hex chars with 0x prefix)"
regex = '''0x[a-fA-F0-9]{64}'''
keywords = ["0x"]

[[rules]]
id = "ethereum-private-key-no-prefix"
description = "Ethereum/EVM Private Key (64 hex chars in quotes)"
regex = '''["'][a-fA-F0-9]{64}["']'''

[[rules]]
id = "solana-private-key-array"
description = "Solana Private Key (byte array)"
regex = '''\[\s*\d{1,3}(?:\s*,\s*\d{1,3}){31,63}\s*\]'''

[extend.allowlist]
# Allow .env.example files
paths = [
'''\.env\.example$''',
'''\.example$''',
'''\.sample$''',
]
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# Run pre-commit hooks (detect private keys, etc.)
pre-commit run

npx lint-staged
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.21.2
hooks:
- id: gitleaks
args: ['--config', '.gitleaks.toml']
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: detect-private-key
- id: detect-aws-credentials
args: ['--allow-missing-credentials']
- id: check-added-large-files
- id: check-merge-conflict
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"author": "Eco Protocol",
"license": "MIT",
"dependencies": {
"@aws-sdk/client-secrets-manager": "^3.946.0",
"@coral-xyz/anchor": "^0.31.1",
"@solana/spl-token": "^0.4.14",
"@solana/web3.js": "^1.91.8",
Expand All @@ -41,14 +42,17 @@
"commander": "^12.1.0",
"dotenv": "^16.4.5",
"inquirer": "^9.3.7",
"js-yaml": "^4.1.1",
"ora": "^8.2.0",
"tronweb": "^6.0.0",
"viem": "^2.21.58"
"viem": "^2.21.58",
"zod": "^4.1.13"
},
"devDependencies": {
"@types/bn.js": "^5.2.0",
"@types/inquirer": "^9.0.7",
"@types/jest": "^30.0.0",
"@types/js-yaml": "^4.0.9",
"@types/node": "^20.16.16",
"@typescript-eslint/eslint-plugin": "^8.43.0",
"@typescript-eslint/parser": "^8.43.0",
Expand Down
Loading