api.singlebroker.com Open in urlscan Pro
3.124.28.181  Public Scan

Submitted URL: http://api.singlebroker.com/
Effective URL: https://api.singlebroker.com/
Submission: On November 25 via api from US — Scanned from US

Form analysis 1 forms found in the DOM

<form class="download-url-wrapper"><input class="download-url-input" type="text" value="./openapi.json"><button class="download-url-button button">Explore</button></form>

Text Content

Explore


SINGLEBROKER API

 1.1.0b 

[ Base URL: api.dev.singlebroker.com ]

./openapi.json


INTRODUCTION

This is an introduction to Single Broker API


HTTP RESPONSES

With every response the API will return standart HTTP statuses, including error
codes.
Generally speaking, every HTTP satus falls under one of these categories:

HTTP Status code rangeDescription 200Your request was fulfilled successfully and
no error was
encountered 400There was a problem with request that was sent. Common
cases are incorrect body parameters, rate limit violation or
insufficient permissions for the desired action 500Well, this case generally
idicates a server-side problem

In case of error, the response will contain a JSON object in their body with
additional
information about the problem:

NameTypeDescription codeintegerAn indentifier of en error throught our system
errorstringA short name of the error occured messagestringGenerally, a
human-readable message that explains the cause of an error


EXAMPLE ERROR RESPONSE

 HTTP/1.1 400 Bad Request
 {
    "code": 11,
    "error": "INCORRECT_INPUT_DATA",
    "message": "Invalid value of parameter apiKey"
 }



AUTHENTICATION

To get access to our API, an API-key and Secret are required. Both can be
created
in API-management tab of Single Broker platfrom.

Each request to API will require several additional headers:

NameDescription DateA date format described in RFC7231 DigestA digest of a
request body to validate incoming request AuthorizationAn authorization header
that contains your API-key, validation headers and signature


EXAMPLE

Request: https://api.dev.singlebroker.com/private/v1/meta/getAccount

Request Body:

 {
    "id": "YourAccountId"
 }


 1. Add Date Header to your request.
    
    DATE HEADER EXAMPLE
    
    Date: Mon, 14 Feb 2022 12:25:30 GMT

 2. Creating a Digest Header:
    2.1 Calculate SHA-256 hash of your request body
    2.2 Convert calculated hash into base64 format. Result: "BASE64_DIGEST"
    2.3 Your Digest Header value is "SHA-256=BASE64_DIGEST"
    2.4 Add Digest Header to your request

 3. Creating an Authorization Header
    3.1 Create a Signing string for request in following format:
    
    date: {DateHeaderValue}\n{RequestMethod} /{Endpoint} HTTP/1.1\ndigest:
    {DigestHeaderValue}
    
    SIGNING STRING EXAMPLE
    
    date: Mon, 14 Feb 2022 12:25:30 GMT\nPOST /private/v1/meta/getAcccount
    HTTP/1.1\ndigest: SHA-256=BASE64_DIGEST
    
    3.2 Calculate hmac-sha256 of Signing string using the Secret
    3.3 Convert calculated value into base64 format. This is your Signature
    3.4 Create Authorization Header value would be:
    
    hmac username="API-key", algorithm="hmac-sha256", headers="date request-line
    digest", signature="Signature"
    
    3.3 Add Authorization Header to your request

 4. As a result, your request should look something like this
    
    $ curl POST http://api.dev.singlebroker.com/private/v1/met/getAccount \
    -H "Date: Mon, 14 Feb 2022 12:25:30 GMT" \
    -H "Digest: Body_Digest" \
    -H 'Authorization: hmac username="API-key", algorithm="hmac-sha256", headers="date request-line digest", signature="Singnature"' \
    -d "{"id":"your_account_id"}"
    


RATE LIMITS

We enforce several kinds of rate limits for our API.

First, there are rate limits per API-key. Current values are:

 * 10 Requests per second
 * 300 Requests per minute

Second, there are rate limits per User. Current values are:

 * xx requests per second
 * 600 requests per minute

Add information about where to see this rate limits

Each request has its own time to live and after reaching this time,
request is expired and no longer contributes toward the rate-limit count.

If you reach the specified rate-limits, subsequent requests will receive
a 429 error code, indicating that you need to wait a certain amount of time
before making next request.


REQUEST QUOTA

In addition to API-key, a certain amount of quota is required to perform requets
to our API.

Quota is defined per user(not per API-key) and each requets towards our API
counts as 1 quota.

If quota reaches zero, then all subsequent requests will return a 429 HTTP Error
Code USER_QUOTA_EXCEEDED
To get additional quota, user may proceed to there.


PAGINATION

Most of requests that are supposed to return multiple elements support
pagination parameters

NameTypeDescription includeTotalbooleanIf set, additional pagination headers
X-Total-Count and X-Total-Pages wiil be returned pageintegerA number of the
desired page. Default value is 1 perPageintegerA number of records per page

Responses for this requests will contation additional pagination headers:

NameTypeDescription X-PageintegerCurrent page X-Per-PageintegerA number of
records requested per page X-CountintegerA number of records returned
X-Total-CountintegerOverall number of records X-Total-PagesintegerOverall number
of pages

Schemeshttps
Authorize



ACCOUNTS


POST/private/v1/accounts/create
Creates an account
POST/private/v1/accounts/update
Updates information about account
POST/private/v1/accounts/revoke
Revoke accounts
POST/private/v1/accounts/share
Shares an account
POST/private/v1/accounts/refuse
Refuse account
POST/private/v1/accounts/requests/admit
Admit account request
POST/private/v1/accounts/requests/reject
Reject account request
POST/private/v1/accounts/requests/cancel
Cancels account request
POST/private/v1/accounts/getManagers
Gets account managers
POST/private/v1/generalMeta/getPolicies
Retrieve platform policies
POST/private/v1/meta/getAccount
Retrieve account info
POST/private/v1/meta/getAccountRequest
Retrieve account request by id
POST/private/v1/meta/getAccountRequests
Retrieve account requests
POST/private/v1/meta/getAccounts
Retrieve accounts
POST/private/v1/meta/getBalance
Retrieve balance info
POST/private/v1/meta/getBalances
Retrieve balances
POST/private/v1/meta/getRole
Retrieve user-created role info
POST/private/v1/meta/getRoles
Retrieve user-created roles


APIMANAGEMENT


POST/private/v1/apiManagement/getCurrentKey
Gets information about existing API-key


PORTFOLIO


POST/private/v1/portfolio/getChartPoints
Get chart points
POST/private/v1/portfolio/getCurrentPNL
Gets today's PNL in USD
POST/private/v1/portfolio/getPNLHistory
Gets daily PNL values for a required period of time
POST/private/v1/portfolio/getTrades
Gets trades


WALLETS


POST/private/v1/wallet/getAddress
Generate a deposit address
POST/private/v1/wallet/deposit/create
Create a new deposit request
POST/private/v1/wallet/deposit/cancel
Cancel a newly created deposit request
POST/private/v1/wallet/withdraw
Withdraw asset to external address
POST/private/v1/wallet/transfer
Transfer asset inside the platform environment
POST/private/v1/wallet/getTransferFees
Reterieve transfer fee values
POST/private/v1/wallet/getWithdrawalFees
Reterieve withdrawal fee values
POST/private/v1/meta/getAccountTransferLimit
Retrieve account transfer limit
POST/private/v1/meta/getTransfer
Retrieve transfer info
POST/private/v1/meta/getTransfers
Retrieve transfers list
POST/private/v1/meta/getUserTransferAddresses
Retrieve the list of addresses, registered for certain user


USER


POST/private/v1/users/getCurrentUser
Gets current user information
POST/private/v1/meta/getNotifications
Retrieve user notifications


DEFI


POST/private/v1/dex/addLiquidity
Adds liquidity to pool
POST/private/v1/dex/approve
Sets Quantity as the allowance of spender over the caller’s tokens.
POST/private/v1/dex/approveLiquidity
Approves provided percent of liquidity to spend by exchange spender if is not
already approved
POST/private/v1/dex/checkApproval
Checks if the approved amount is sufficient
POST/private/v1/dex/checkApprovalStatus
Checks if the approved amount is sufficient
POST/private/v1/dex/checkLiquidityApproval
Checks if provided percent of liquidity is approved to spend by exchange spender
POST/private/v1/dex/checkLiquidityApprovalStatus
Checks if provided percent of liquidity is approved to spend by exchange spender
POST/private/v1/dex/executeTransaction
Executes prepared transaction
POST/private/v1/dex/getAllowance
Returns the approved amount of funds
POST/private/v1/dex/getGasPrice
Get gas price for provided DeX
POST/private/v1/dex/getGasPrices
Get gas prices for provided DeX
POST/private/v1/dex/getPoolInfo
Gets pool info by two asset symbols and fee
POST/private/v1/dex/getPosition
Gets position info by two asset symbols and fee
POST/private/v1/dex/getQuotes
Get liquidity pools list with quotes
POST/private/v1/dex/prepareAddLiquidity
Prepares remove add liquidity transaction, returns fee params and cached
transaction uid
POST/private/v1/dex/prepareApprove
Prepares approve transaction, returns fee params and cached transaction uid
POST/private/v1/dex/prepareApproveLiquidity
Prepares approve liquidity transaction, returns fee params and cached
transaction uid
POST/private/v1/dex/prepareRemoveLiquidity
Prepares remove liquidity transaction, returns fee params and cached transaction
uid
POST/private/v1/dex/prepareSwap
Prepares swap transaction, returns fee params and cached transaction uid
POST/private/v1/dex/removeLiquidity
Removes liquidity from pool
POST/private/v1/dex/swap
Swap assets action
POST/private/v1/meta/getDexPosition
Retrieve dex position info
POST/private/v1/meta/getDexPositions
Retrieve dex positions list
POST/private/v1/meta/getDexTransaction
Retrieve dex transaction info
POST/private/v1/meta/getDexTransactions
Retrieve dex transactions list


PUBLICDATA


POST/private/v1/generalMeta/getAsset
Retrieve asset info
POST/private/v1/generalMeta/getAssetQuotation
Retrieve asset quotation for specified pair of assets
POST/private/v1/generalMeta/getAssetQuotations
Retrieve asset quotation for given pair
POST/private/v1/generalMeta/getAssets
Retrieve list of assets
POST/private/v1/generalMeta/getBlockchain
Retrieve blockchain info
POST/private/v1/generalMeta/getBlockchains
Retrieve blockchain list
POST/private/v1/generalMeta/getDexExchange
Retrieve DEX data
POST/private/v1/generalMeta/getDexExchanges
Retrieve DEX data list
POST/private/v1/generalMeta/getDexPools
Retrieve DEX pools list
POST/private/v1/generalMeta/getPlacement
Retrieve certain placement
POST/private/v1/generalMeta/getPlacements
Retrieve supported placements
POST/private/v1/generalMeta/getSpotAssetPair
Retrieve certain spot asset pair
POST/private/v1/generalMeta/getSpotAssetPairs
Retrieve spot asset pairs


MARKETDATA


POST/private/v1/generalMeta/getOrderBook
Retrieve order book
POST/private/v1/generalMeta/getSpotTrades
Retrieve spot trades
POST/private/v1/generalMeta/getTradingData
Retrieve trading data by instruments (current price, price changes 24h, volume
24h)


TRADING


POST/private/v1/meta/futures/getCurrentLeverage
Retrieve currently opened futures positions
POST/private/v1/meta/futures/getFundingRecords
Retrieve futures funding records
POST/private/v1/meta/futures/getOrder
Retrieve spot order data
POST/private/v1/meta/futures/getOrders
Retrieve futures orders
POST/private/v1/meta/futures/getPosition
Retrieve currently opened futures position
POST/private/v1/meta/futures/getPositions
Retrieve currently opened futures positions
POST/private/v1/meta/futures/getTrade
Retrieve spot trade info
POST/private/v1/meta/futures/getTrades
Retrieve spot trades
POST/private/v1/meta/spot/getOrder
Retrieve spot order data
POST/private/v1/meta/spot/getOrders
Retrieve spot orders
POST/private/v1/meta/spot/getTrade
Retrieve spot trade info
POST/private/v1/meta/spot/getTrades
Retrieve spot trades
POST/private/v1/meta/spot/getTradingCommissionRate
Retrieve spot trading commission rate
POST/private/v1/orders/cancelOrder
Cancel spot order
POST/private/v1/orders/placeOrder
Place spot order


PRIVATEDATA


POST/private/v1/meta/getStreamChannels
Retrieve ws channels to subscribe
POST/private/v1/meta/getStreamToken
Retrieve token for ws subscription
POST/private/v1/meta/refreshStreamToken
Refresh ws token


STATEMENTS


POST/private/v1/statements/dex/getLiquidityTransactions

POST/private/v1/statements/dex/getSwapTransactions

POST/private/v1/statements/dex/getTransactionsTotal

POST/private/v1/statements/fundings/getFutures

POST/private/v1/statements/fundings/getFuturesTotal

POST/private/v1/statements/orders/getFuturesOrders

POST/private/v1/statements/orders/getFuturesSummary

POST/private/v1/statements/orders/getFuturesTotal

POST/private/v1/statements/orders/getSpotOrders

POST/private/v1/statements/orders/getSpotStatuses

POST/private/v1/statements/orders/getSpotSummary

POST/private/v1/statements/orders/getSpotTotal

POST/private/v1/statements/summary/getBalanceHistory

POST/private/v1/statements/summary/getCurrentBalance

POST/private/v1/statements/summary/getFinances

POST/private/v1/statements/summary/getSummary

POST/private/v1/statements/trades/getFuturesTotal

POST/private/v1/statements/trades/getFuturesTrades

POST/private/v1/statements/trades/getSpotTotal

POST/private/v1/statements/trades/getSpotTrades

POST/private/v1/statements/transfers/getCommission

POST/private/v1/statements/transfers/getStatuses

POST/private/v1/statements/transfers/getSummary

POST/private/v1/statements/transfers/getTransfers

POST/private/v1/statements/transfers/getTypes