TRANSACTIONS

This section provides an overview of the REST API endpoint for retrieving trades for a specific user. The endpoint allows subscribers to get a list of trades, with an optional parameter to specify the starting time.

Endpoint

1. Get User Trades

  • HTTP Request Type: GET

  • Route: /firestapi/transactions/trades/:userid

  • URL / Body Parameters:

    • :userid - The user ID for whom the trades are being retrieved.

    • fromtime (optional) - The starting time in milliseconds since the epoch (January 1, 1970).

  • Info: This endpoint returns trades for a specific user. It will return a maximum of 1000 records.

  • HTTPS Body Example: N/A

  • WS Example:

json

{
  "type": "get_trades",
  "userid": "12345",
  "fromtime": 1671195975792
}

Example Implementation in Express.js

Here's an example of how you might implement this endpoint in an Express.js application:

javascript

This example sets up the specified route using Express.js and handles retrieving trades for a specific user, with optional filtering by starting time. It includes necessary validations and error handling for the endpoint.

Last updated