Skip to main content

Interfaces

JwtOptions

Defined in: utils/jwt.ts:20 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.

Properties

apiKeyId
apiKeyId: string;
Defined in: utils/jwt.ts:28 The API key ID Examples: ‘xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx’ ‘organizations/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/apiKeys/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx’
apiKeySecret
apiKeySecret: string;
Defined in: utils/jwt.ts:37 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))
requestMethod?
optional requestMethod: string | null;
Defined in: utils/jwt.ts:42 The HTTP method for the request (e.g. ‘GET’, ‘POST’), or null for JWTs intended for websocket connections
requestHost?
optional requestHost: string | null;
Defined in: utils/jwt.ts:47 The host for the request (e.g. ‘api.cdp.coinbase.com’), or null for JWTs intended for websocket connections
requestPath?
optional requestPath: string | null;
Defined in: utils/jwt.ts:52 The path for the request (e.g. ‘/platform/v1/wallets’), or null for JWTs intended for websocket connections
expiresIn?
optional expiresIn: number;
Defined in: utils/jwt.ts:57 Optional expiration time in seconds (defaults to 120)
audience?
optional audience: string[];
Defined in: utils/jwt.ts:62 Optional audience claim for the JWT

WalletJwtOptions

Defined in: utils/jwt.ts:71 WalletJwtOptions contains configuration for Wallet Auth JWT generation. This interface holds all necessary parameters for generating a Wallet Auth JWT for authenticating with endpoints that require wallet authentication.

Properties

walletSecret
walletSecret: string;
Defined in: utils/jwt.ts:75
  • The Wallet Secret
requestMethod
requestMethod: string;
Defined in: utils/jwt.ts:80
  • The HTTP method for the request (e.g. ‘GET’, ‘POST’)
requestHost
requestHost: string;
Defined in: utils/jwt.ts:85
  • The host for the request (e.g. ‘api.cdp.coinbase.com’)
requestPath
requestPath: string;
Defined in: utils/jwt.ts:90
  • The path for the request (e.g. ‘/platform/v1/wallets/{wallet_id}/addresses’)
requestData
requestData: Record<string, any>;
Defined in: utils/jwt.ts:96
  • The request data for the request (e.g. { "wallet_id": "1234567890" })

Functions