Skip to content

Class: BrokerClient ​

Extends ​

  • BaseRestClient

Constructors ​

Constructor ​

ts
new BrokerClient(restClientOptions?: RestClientOptions, networkOptions?: AxiosRequestConfig): BrokerClient;

Create an instance of the REST client. Pass API credentials in the object in the first parameter.

Parameters ​

ParameterTypeDescription
restClientOptions?RestClientOptionsoptions to configure REST API connectivity
networkOptions?AxiosRequestConfigHTTP networking options for axios

Returns ​

BrokerClient

Inherited from ​

BaseRestClient.constructor

Methods ​

applyFastWithdrawal() ​

ts
applyFastWithdrawal(params: FastApiWithdrawApplyRequest): Promise<APISuccessResponse<FastApiWithdrawApplyResponse>>;

Apply for Fast Withdrawal

Submit a Fast API withdrawal request to an external address or internal account. Initial request returns 2FA factors; resubmit with validation to complete withdrawal.

Parameters ​

ParameterType
paramsFastApiWithdrawApplyRequest

Returns ​

Promise<APISuccessResponse<FastApiWithdrawApplyResponse>>


createSubAccount() ​

ts
createSubAccount(params: object): Promise<APISuccessResponse<CreateBrokerSubAccountResponse>>;

Add SubAccount

This endpoint supports Broker users to create sub-accounts. Note that the account name is unique across the exchange. It is recommended to add a special identifier to prevent name duplication.

Parameters ​

ParameterType
params{ accountName: string; }
params.accountNamestring

Returns ​

Promise<APISuccessResponse<CreateBrokerSubAccountResponse>>


createSubAccountApi() ​

ts
createSubAccountApi(params: CreateBrokerSubAccountApiRequest): Promise<APISuccessResponse<CreateBrokerSubAccountApiResponse>>;

Add SubAccount API

This interface supports the creation of Broker sub-account APIKEY. Supports up to 20 IPs in the whitelist. Permissions: General, Spot, Margin, Futures, InnerTransfer, Transfer, Earn. Label must be between 4 and 32 characters.

Parameters ​

ParameterType
paramsCreateBrokerSubAccountApiRequest

Returns ​

Promise<APISuccessResponse<CreateBrokerSubAccountApiResponse>>


deletePrivate() ​

ts
deletePrivate(endpoint: string, params?: any): Promise<any>;

Parameters ​

ParameterType
endpointstring
params?any

Returns ​

Promise<any>

Inherited from ​

BaseRestClient.deletePrivate


deleteSubAccountApi() ​

ts
deleteSubAccountApi(params: DeleteBrokerSubAccountApiRequest): Promise<APISuccessResponse<boolean>>;

Delete SubAccount API

This interface supports deleting Broker's sub-account APIKEY.

Parameters ​

ParameterType
paramsDeleteBrokerSubAccountApiRequest

Returns ​

Promise<APISuccessResponse<boolean>>


get() ​

ts
get(endpoint: string, params?: any): Promise<any>;

Parameters ​

ParameterType
endpointstring
params?any

Returns ​

Promise<any>

Inherited from ​

BaseRestClient.get


getBrokerInfo() ​

ts
getBrokerInfo(params: GetBrokerInfoRequest): Promise<APISuccessResponse<BrokerInfo>>;

Get Broker Info

This endpoint supports querying the basic information of the current Broker

Parameters ​

ParameterType
paramsGetBrokerInfoRequest

Returns ​

Promise<APISuccessResponse<BrokerInfo>>


getBrokerRebate() ​

ts
getBrokerRebate(params: object): Promise<APISuccessResponse<{
  url: string;
}>>;

Get Broker Rebate

This interface supports downloading Broker rebate orders. Returns a URL to download a CSV file containing the rebate data. The URL is valid for 1 day. Maximum interval between begin and end dates is 6 months.

Parameters ​

ParameterType
params{ begin: string; end: string; tradeType: "1" | "2"; }
params.beginstring
params.endstring
params.tradeType"1" | "2"

Returns ​

Promise<APISuccessResponse<{ url: string; }>>


getClientType() ​

ts
getClientType(): RestClientType;

Defines the client type (affecting how requests & signatures behave)

Returns ​

RestClientType

Overrides ​

BaseRestClient.getClientType


getDeposit() ​

ts
getDeposit(params: object): Promise<APISuccessResponse<BrokerDepositRecord>>;

Get Deposit Detail

This endpoint supports querying the deposit record of sub-accounts created by a Broker (excluding main account of nd broker).

Status:

  • PROCESSING: Processing
  • SUCCESS: Successful
  • FAILURE: Failed
  • PRE_SUCCESS: Funds credited ahead of final block confirmation
  • WAIT_TRM_MGT: Under compliance verification
  • TRM_MGT_REJECTED: Rejected after compliance verification
  • ROLLBACKING: Reversing deposit
  • ROLLBACK: Deposit reversed, no funds credited
  • WAIT_RISK_MGT: Under risk verification
  • RISK_MGT_REJECTED: Rejected after risk verification

Parameters ​

ParameterType
params{ currency: string; hash: string; }
params.currencystring
params.hashstring

Returns ​

Promise<APISuccessResponse<BrokerDepositRecord>>


getDeposits() ​

ts
getDeposits(params?: GetBrokerDepositListRequest): Promise<APISuccessResponse<BrokerDepositRecord[]>>;

Get Deposit List

This endpoint can obtain the deposit records of each sub-account under the ND Broker. Default limit is 1000 records (max 1000). Results are sorted in descending order by default.

Status:

  • PROCESSING: Processing
  • SUCCESS: Successful
  • FAILURE: Failed
  • PRE_SUCCESS: Funds credited ahead of final block confirmation
  • WAIT_TRM_MGT: Under compliance verification
  • TRM_MGT_REJECTED: Rejected after compliance verification
  • ROLLBACKING: Reversing deposit
  • ROLLBACK: Deposit reversed, no funds credited
  • WAIT_RISK_MGT: Under risk verification
  • RISK_MGT_REJECTED: Rejected after risk verification

Parameters ​

ParameterType
params?GetBrokerDepositListRequest

Returns ​

Promise<APISuccessResponse<BrokerDepositRecord[]>>


getMarkupFee() ​

ts
getMarkupFee(params?: GetBrokerMarkupFeeRequest): Promise<APISuccessResponse<GetBrokerMarkupFeeResponse>>;

Get Markup Fee Default markup plus optional per-UID items.

Parameters ​

ParameterType
params?GetBrokerMarkupFeeRequest

Returns ​

Promise<APISuccessResponse<GetBrokerMarkupFeeResponse>>


getPrivate() ​

ts
getPrivate(endpoint: string, params?: any): Promise<any>;

Parameters ​

ParameterType
endpointstring
params?any

Returns ​

Promise<any>

Inherited from ​

BaseRestClient.getPrivate


getSubAccountApis() ​

ts
getSubAccountApis(params: GetBrokerSubAccountApisRequest): Promise<APISuccessResponse<BrokerSubAccountApi[]>>;

Get SubAccount API

This interface supports querying the Broker's sub-account APIKEYs. Can optionally filter by specific apiKey.

Parameters ​

ParameterType
paramsGetBrokerSubAccountApisRequest

Returns ​

Promise<APISuccessResponse<BrokerSubAccountApi[]>>


getSubAccounts() ​

ts
getSubAccounts(params: GetBrokerSubAccountsRequest): Promise<APISuccessResponse<GetBrokerSubAccountsResponse>>;

Get SubAccount

This interface supports querying sub-accounts created by Broker. Returns paginated results with default page size of 20 (max 100).

Parameters ​

ParameterType
paramsGetBrokerSubAccountsRequest

Returns ​

Promise<APISuccessResponse<GetBrokerSubAccountsResponse>>


getTransferHistory() ​

ts
getTransferHistory(params: object): Promise<APISuccessResponse<BrokerTransferHistory>>;

Get Transfer History

This endpoint supports querying transfer records of the broker itself and its created sub-accounts.

Account Types:

  • MAIN: Funding account
  • TRADE: Spot trading account
  • CONTRACT: Contract account
  • MARGIN: Margin account
  • ISOLATED: Isolated margin account

Status:

  • PROCESSING: Processing
  • SUCCESS: Successful
  • FAILURE: Failed

Parameters ​

ParameterType
params{ orderId: string; }
params.orderIdstring

Returns ​

Promise<APISuccessResponse<BrokerTransferHistory>>


getWithdrawal() ​

ts
getWithdrawal(params: object): Promise<APISuccessResponse<BrokerWithdrawalRecord>>;

Get Withdrawal Detail

This endpoint supports querying the withdrawal records of sub-accounts created by a Broker (excluding main account of nd broker).

Status:

  • PROCESSING: Processing
  • WALLET_PROCESSING: Wallet Processing
  • REVIEW: Under Review
  • SUCCESS: Successful
  • FAILURE: Failed

Parameters ​

ParameterType
params{ withdrawalId: string; }
params.withdrawalIdstring

Returns ​

Promise<APISuccessResponse<BrokerWithdrawalRecord>>


hasAccessToken() ​

ts
hasAccessToken(): boolean;

Returns ​

boolean

Inherited from ​

BaseRestClient.hasAccessToken


post() ​

ts
post(endpoint: string, params?: any): Promise<any>;

Parameters ​

ParameterType
endpointstring
params?any

Returns ​

Promise<any>

Inherited from ​

BaseRestClient.post


postPrivate() ​

ts
postPrivate(
   endpoint: string, 
   params?: any, 
   internalReqContext?: InternalRequestContext
): Promise<any>;

Parameters ​

ParameterType
endpointstring
params?any
internalReqContext?InternalRequestContext

Returns ​

Promise<any>

Inherited from ​

BaseRestClient.postPrivate


setAccessToken() ​

ts
setAccessToken(newAccessToken: string): void;

Parameters ​

ParameterType
newAccessTokenstring

Returns ​

void

Inherited from ​

BaseRestClient.setAccessToken


setMarkupFee() ​

ts
setMarkupFee(params: SetBrokerMarkupFeeRequest): Promise<APISuccessResponse<SetBrokerMarkupFeeResponse>>;

Set Markup Fee Maker and taker markup must be set together. Both 0 cancels markup.

Parameters ​

ParameterType
paramsSetBrokerMarkupFeeRequest

Returns ​

Promise<APISuccessResponse<SetBrokerMarkupFeeResponse>>


submitTransfer() ​

ts
submitTransfer(params: BrokerTransferRequest): Promise<APISuccessResponse<{
  orderId: string;
}>>;

Transfer

This endpoint supports fund transfer between Broker account and Broker sub-accounts. Please be aware that withdrawal from sub-account is not directly supported. Broker has to transfer funds from broker sub-account to broker account to initiate the withdrawals.

Direction:

  • OUT: Broker account is transferred to Broker sub-account
  • IN: Broker sub-account is transferred to Broker account

Account Types:

  • MAIN: Funding account
  • TRADE: Spot trading account

Parameters ​

ParameterType
paramsBrokerTransferRequest

Returns ​

Promise<APISuccessResponse<{ orderId: string; }>>


updateSubAccountApi() ​

ts
updateSubAccountApi(params: UpdateBrokerSubAccountApiRequest): Promise<APISuccessResponse<BrokerSubAccountApi>>;

Modify SubAccount API

This interface supports modifying the Broker's sub-account APIKEY. Supports up to 20 IPs in the whitelist. Permissions: General, Spot, Margin, Futures, InnerTransfer, Transfer, Earn. Label must be between 4 and 32 characters.

Parameters ​

ParameterType
paramsUpdateBrokerSubAccountApiRequest

Returns ​

Promise<APISuccessResponse<BrokerSubAccountApi>>

Built by Siebly. Open source SDKs for exchange APIs.