This example can be run directly or with Docker.
You will need a private key of the Ethereum account that will control your Paradex account. Refer to how to export an account's private key on MetaMask.
ETHEREUM_PRIVATE_KEYPARADEX_PRIVATE_KEY
All commands below are to be run from go directory.
To run it directly, ensure Go 1.20.3+ is installed.
go run .What this example does:
- Generates and onboards a new Paradex account based on your Ethereum private key
- Retrieves a JWT to be used to make requests to private endpoints of the API
- Submits a new order to the private
POST /ordersendpoint using the JWT - Makes a request to the private
GET /ordersendpoint using the JWT
Refer to the main function under onboarding.go for the main flow that consists of:
- Perform onboarding
- Authenticate and retrieve a JWT
- Calling multiple private endpoints