How to sign API requests with authentication
ChainStream uses API keys to authenticate all API calls. The Base API URL will be one of the following depending on your workspace environment type:
https://api-dex.chainstream.io/
Each API request must include the following headers:
Authorization
- This value should be set to Bearer <Access Token>
. The access token is a Base64 encoded JSON Web Token (JWT).You can generate a JWT token using the following code:
After generating the JWT token, you can use it to initialize the SDK:
Make sure to replace the placeholder values with your actual API credentials.