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
apiKeySecret
requestMethod?
requestHost?
requestPath?
expiresIn?
audience?
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
- The Wallet Secret
requestMethod
- The HTTP method for the request (e.g. ‘GET’, ‘POST’)
requestHost
- The host for the request (e.g. ‘api.cdp.coinbase.com’)
requestPath
- The path for the request (e.g. ‘/platform/v1/wallets//addresses’)
requestData
- The request data for the request (e.g.
{ "wallet_id": "1234567890" }
)
Functions
generateJwt()
Parameters
options
JwtOptions
The configuration options for generating the JWT
Returns
Promise
<string
>
The generated JWT (Bearer token) string
Throws
If required parameters are missing, invalid, or if JWT signing failsgenerateWalletJwt()
Parameters
options
WalletJwtOptions
The configuration options for generating the JWT
Returns
Promise
<string
>
The generated JWT (Bearer token) string