How to use the ccxt.BaseError function in ccxt

To help you get started, we’ve selected a few ccxt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aloysius-pgast / crypto-exchanges-gateway / app / default-ccxt-client.js View on Github external
async getTicker(pair, ccxtParams)
{
    let ccxtPair = this._toCcxtPair(pair);
    let data;
    try
    {
        data = await this.ccxt.fetchTicker(ccxtPair, ccxtParams);
    }
    catch (e)
    {
        if (e instanceof ccxt.BaseError)
        {
            throw new CcxtErrors.BaseError(e, undefined, undefined, undefined);
        }
        throw e;
    }
    return {ccxt:data,custom:this.formatTicker(pair, data)};
}