JwtOptions contains configuration for JWT generation.

This interface holds all necessary parameters for generating a JWT token for authenticating with Coinbase's REST APIs. It supports both EC (ES256) and Ed25519 (EdDSA) keys.

interface JwtOptions {
    apiKeyId: string;
    apiKeySecret: string;
    expiresIn?: number;
    requestHost: string;
    requestMethod: string;
    requestPath: string;
}

Properties

apiKeyId: string

The API key ID

Examples: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' 'organizations/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/apiKeys/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'

apiKeySecret: string

The API key secret

Examples: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==' (Edwards key (Ed25519)) '-----BEGIN EC PRIVATE KEY-----\n...\n...\n...==\n-----END EC PRIVATE KEY-----\n' (EC key (ES256))

expiresIn?: number

Optional expiration time in seconds (defaults to 120)

requestHost: string

The host for the request (e.g. 'api.cdp.coinbase.com')

requestMethod: string

The HTTP method for the request (e.g. 'GET', 'POST')

requestPath: string

The path for the request (e.g. '/platform/v1/wallets')