REST accepts incoming arguments and returns a response with data encoded in JSON format.
The REST API rate limit is based on the rolling time window per 10 seconds and IP address. Current value is 120 requests per 10 seconds. On exceeding that value you will be blocked on 10 seconds and will get 429 HTTP error on all requests.
REST API consists of public and private endpoints. Public endpoints are available for everyone to call and return general market/platform data.
Private endpoints require input data to be signed with Starknet Account private key.
To get signature
1. all input query/body parameters and timestamp parameters are merged as a single object
const hash = getHash({
//query or body params,
timestamp,
});
sorted by key name, converted to bytes and keccak hash of starknet curve is applied.
Once you have the signature computed, you need to pass the calculated data in request HTTP headers:
'x-public-key' - public key associated with Starknet Account private key
'x-account-id' - account id of trading account
'x-timestamp' - the number of milliseconds elapsed since the epoch, which is defined as the midnight at the beginning of January 1, 1970, UTC
'x-signature-1' - r part of signature
'x-signature-2' - s part of signaure
'x-request-id' - request id to sent to support for troubleshooting