Make backend API calls

Constructors

Properties

Methods

Constructors

  • Create class instance

    Parameters

    • apiKey: string

      Crypto Bot API key, looks like '1234:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'

    • endpoint: string

      API endpoint url or 'mainnet' or 'testnet' for hardcoded in library endpoint urls

    Returns Transport

    Error - If passed invalid API key or endpoint

Properties

KEY_CHECK_REGEXP: RegExp = ...

RegExp to check API key

_apiKey: string

Api key

_baseUrl: string

Backend API endpoint base url

Methods

  • Make request to backend API, handle errors and return result

    Parameters

    • method: ApiMethod

      Backend API method name

    • Optionalparameters: object

      Method parameters object

    Returns Promise<any>

    Promise, what resolved to API response result field

    Error - If response have errors