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=trueURL / 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=trueURL / 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/:securityURL / 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/securitiesURL / Body Parameters:
REQUIRED:
security: Stringtype: String ["deposit", "trading", "crypto-pair"]fractionbase: Number
OPTIONAL:
description: Stringname: String
REQUIRED IF TYPE trading:
clearinginstrument: String
OPTIONAL IF TYPE trading:
comm: Numberpriceprecision: Number
REQUIRED IF TYPE crypto-pair:
firstpair: Stringsecondpair: 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/:securityURL / Body Parameters:
OPTIONAL:
fractionbase: Number (### HEAVY WARNING IF YOU HAVE LIVE ORDERS ###)description: Stringname: Stringpriceprecision: 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