SECURITIES

The Securities section of the RESTAPI allows subscribers to perform various operations related to securities, including listing, retrieving details, adding, and modifying securities

Endpoints

1. Get Currency List

  • HTTP Request Type: GET

  • Route: /firestapi/securities?deposit=true

  • URL / Body Parameters: None

  • Info: Lists all the currencies registered in the system, including FIAT and Cryptocurrency.

2. Get Tradeable Pairs

  • HTTP Request Type: GET

  • Route: /firestapi/securities?pair=true

  • URL / Body Parameters: None

  • Info: Lists all the tradeable pairs. This is the same route as above with a different URL parameter.

3. Get Instrument Details

  • HTTP Request Type: GET

  • Route: /firestapi/securities/:security

  • URL / Body Parameters: :security - the symbol of the security.

  • Info: Provides details of an individual pair. The route will check if the entered symbol is tradable or not before returning the information.

  • HTTPS Body Example: N/A

  • WS Example:

json

4. Add New Security

  • HTTP Request Type: POST

  • Route: /firestapi/securities

  • URL / Body Parameters:

    • REQUIRED:

      • security: String

      • type: String ["deposit", "trading", "crypto-pair"]

      • fractionbase: Number

    • OPTIONAL:

      • description: String

      • name: String

    • REQUIRED IF TYPE trading:

      • clearinginstrument: String

    • OPTIONAL IF TYPE trading:

      • comm: Number

      • priceprecision: Number

    • REQUIRED IF TYPE crypto-pair:

      • firstpair: String

      • secondpair: String

    • OPTIONAL IF TYPE crypto-pair:

      • priceprecision: Number

  • Info: Adds a new security. When creating a crypto-pair, this request will throw an error if the firstpair + secondpair does not equal the security string.

  • HTTPS Body Example:

json

OR

json

OR

json

WS Example:

json

OR

json

OR

json'

5. Modify Existing Security

  • HTTP Request Type: POST

  • Route: /firestapi/securities/:security

  • URL / Body Parameters:

    • OPTIONAL:

      • fractionbase: Number (### HEAVY WARNING IF YOU HAVE LIVE ORDERS ###)

      • description: String

      • name: String

      • priceprecision: Number

    • OPTIONAL IF TYPE trading:

      • comm: Number

  • Info: Edits an existing security. The route checks if the security being edited exists, then follows similar constraints for the create route based on the type of security ("deposit", "trading", "crypto-pair").

  • HTTPS Body Example:

json

OR

json

Example Implementation in Express.js

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

javascript

This example sets up the specified routes using Express.js, handles getting currency lists, getting instrument details, adding new securities, and modifying existing securities. It includes the necessary validations and error handling for the endpoints.

Last updated