src/shared contains reusable modules consumed by cb and hdb.
This directory is internal to the monorepo and is not documented as a standalone package.
coinbase/: Coinbase REST, signing, credentials, product/order helperscoinbase/schemas/: zod schemas for Coinbase payloadscommon/: env loading, delay, cache helpers, numeric helperscommon/schemas/: env schemalog/: logger, error, and order logging helpersschemas/: shared primitive schemasbin/validate-env.ts:helper-env-checkCLI entrypoint
Shared env loading uses this order:
- explicit path passed by tooling (for example
helper-env-check --env-file <path>) HELPER_ENV_FILE- default path:
${XDG_CONFIG_HOME:-$HOME/.config}/helper/.env
Minimum required Coinbase variable:
HELPER_COINBASE_CREDENTIALS_PATH=/absolute/path/to/coinbase-credentials.json
HELPER_ALLOW_LIVE_EXCHANGE=truehdb also requires:
HELPER_POSTGRES_DATABASE=...
HELPER_POSTGRES_USERNAME=...
HELPER_POSTGRES_PASSWORD=...Validate env file and Coinbase credential parsing:
npm run build
npm link
helper-env-checkOptional custom env path:
helper-env-check --env-file /absolute/path/to/.envUse Coinbase App API credentials created in CDP with ECDSA/ES256.
When creating the key in CDP, be sure to select the ECDSA signature algorithm.
Expected JSON structure:
{
"name": "organizations/{org_id}/apiKeys/{key_id}",
"privateKey": "-----BEGIN EC PRIVATE KEY-----\n...\n-----END EC PRIVATE KEY-----\n"
}Reference: https://docs.cdp.coinbase.com/coinbase-app/authentication-authorization/api-key-authentication