Crypto Bot API
    Preparing search index...

    Class Client

    Main class for work with API for browsers

    Library for browsers default export this class

    Hierarchy (View Summary)

    Index

    Constructors

    • Create class instance

      Parameters

      • apiKey: string

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

      • endpoint: string = 'mainnet'

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

      Returns Client

      Error - If passed invalid API key or endpoint

    Properties

    CheckStatus: typeof CheckStatus = CheckStatus

    Access to CheckStatus enumeration, used in Check type, Client.getChecks and Client.getChecksPaginate methods options

    CurrencyType: typeof CurrencyType = CurrencyType

    Access to CurrencyType enumeration, used in Invoice type

    DetailedCurrencyType: typeof DetailedCurrencyType = DetailedCurrencyType

    Access to DetailedCurrencyType enumeration, used in Store.getCurrencies and Client.getCurrency methods results

    InvoiceStatus: typeof InvoiceStatus = InvoiceStatus

    Access to InvoiceStatus enumeration, used in Invoice type, Client.getInvoices and Client.getInvoicesPaginate methods options

    TransferStatus: typeof TransferStatus = TransferStatus

    Access to TransferStatus enumeration, used in Transfer type, Client.getTransfers and Client.getTransfersPaginate methods options

    _transport: Transport

    Transport class instance

    _pageSize: number = 100

    Page size for Client.getInvoicesPaginate method

    Methods

    • Call backend API method directly (types unsafe)

      Use it if backend API update (add new methods, change request or response fileds), but library is not

      Parameters

      • method: string

        Backend API method name

      • options: object = {}

        Backend API options object

      Returns Promise<any>

      Promise, what resolved to backend API response result field value

      Error - If there is an error sending request to backend API or parsing response

    • Delete check

      Parameters

      • id: number

        Check identifier

      Returns Promise<boolean>

      Promise, what resolved to boolean operation result status

      Error - If there is an error sending request to backend API or parsing response error

    • Delete invoice

      Parameters

      • id: number

        Invoice identifier

      Returns Promise<boolean>

      Promise, what resolved to boolean operation result status

      Error - If there is an error sending request to backend API or parsing response error

    • Get API app balance value for passed currency

      Call Client.getBalances method to fetch balances information

      Parameters

      Returns Promise<string>

      Promise, what resolved to API app available balance value for passed currency

      Error - If there is an error sending request to backend API or parsing response

    • Get API app balance value for passed currency

      Call Client.getBalances method to fetch balances information

      Parameters

      Returns Promise<string>

      Promise, what resolved to API app balance on hold value for passed currency

      Error - If there is an error sending request to backend API or parsing response

    • Get API app balances infomation

      Use toBalances backend API result convert function

      Returns Promise<Balances>

      Promise, what resolved to API app balances infomation object

      Error - If there is an error sending request to backend API or parsing response

    • Get API app balances infomation

      Use toBalances backend API result convert function

      Returns Promise<BalancesType>

      Promise, what resolved to API app available balances infomation object

      Error - If there is an error sending request to backend API or parsing response

    • Get API app balances infomation

      Use toBalances backend API result convert function

      Returns Promise<BalancesType>

      Promise, what resolved to API app balances on hold infomation object

      Error - If there is an error sending request to backend API or parsing response

    • Get API supported currencies infomation

      Use toCurrencies backend API result convert function

      Parameters

      • OptionalisForce: boolean

        If true, return fresh data from backend API, not from cache

      Returns Promise<Currencies>

      Promise, what resolved to API supported currencies infomation object

      Error - If there is an error sending request to backend API or parsing response

    • Get currency with passed code infomation

      Call Store.getCurrencies method to fetch currencies information

      Parameters

      • currencyCode: CurrencyCode

        Currency code

      • isForce: boolean = false

        If true, return fresh data from backend API, not from cache

      Returns Promise<Currency>

      Promise, what resolved to currency with passed code infomation object or null, if currency with passed code not exists

      Error - If there is an error sending request to backend API or parsing response

    • Get one exchange rate infomation to passed currencies pair

      Call Store.getExchangeRates method to fetch exchange rates information, Store.getCurrencies method to fetch currencies information and use getExchageRate function to get signle exchange rate

      Parameters

      • source: string

        Source currency code

      • target: string

        Target currency code

      • isForce: boolean = false

        If true, return fresh data from backend API, not from cache

      Returns Promise<string>

      Promise, what resolved to exchange rate or zero, if currencies pair not exists

      Error - If there is an error sending request to backend API or parsing response

    • Get API supported currencies exchange rate infomation

      Use toExchangeRates backend API result convert function

      Parameters

      • OptionalisForce: boolean

        If true, return fresh data from backend API, not from cache

      Returns Promise<ExchangeRates>

      Promise, what resolved to API supported currencies exchange rate infomation object

      Error - If there is an error sending request to backend API or parsing response

    • Get associated with passed API key app infomation

      Use toMe backend API result convert function

      Parameters

      • isForce: boolean = false

        If true, return fresh data from backend API, not from cache

      Returns Promise<Me>

      Promise, what resolved to associated with passed API key app infomation object

      Error - If there is an error sending request to backend API or parsing response

    • Get associated with passed API key app statistics

      Use toStats backend API result convert function

      Parameters

      Returns Promise<Stats>

      Promise, what resolved to associated with passed API key app statistics object

      Error - If there is an error sending request to backend API or parsing response

    • Set count invoices per page for Client.getInvoicesPaginate method

      Parameters

      • pageSizeParam: number

        Invoices per page

      Returns void

      Error - If pageSize parameter is invalid