()
| 86 | |
| 87 | /** Retrieves the private key from environment or global config */ |
| 88 | export function getX402PrivateKey(): string | undefined { |
| 89 | // Environment variable takes precedence (for CI/automation) |
| 90 | if (process.env.X402_PRIVATE_KEY) { |
| 91 | return process.env.X402_PRIVATE_KEY |
| 92 | } |
| 93 | const config = getGlobalConfig() |
| 94 | return (config as Record<string, unknown>).x402PrivateKey as string | undefined |
| 95 | } |
| 96 | |
| 97 | /** Checks if x402 payments are configured and enabled */ |
| 98 | export function isX402Enabled(): boolean { |
no test coverage detected