How to use the @requestnetwork/types.RequestLogic.REQUEST_LOGIC_CURRENCY function in @requestnetwork/types

To help you get started, we’ve selected a few @requestnetwork/types 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 RequestNetwork / requestNetwork / packages / request-client.js / src / api / utils.ts View on Github external
getDecimalsForCurrency(currency: RequestLogicTypes.REQUEST_LOGIC_CURRENCY): number {
    const decimals = {
      [RequestLogicTypes.REQUEST_LOGIC_CURRENCY.ETH]: 18,
      [RequestLogicTypes.REQUEST_LOGIC_CURRENCY.BTC]: 8,
    }[currency];
    if (!decimals) {
      throw new Error(`Currency ${currency} not implemented`);
    }
    return decimals;
  },
};
github RequestNetwork / requestNetwork / packages / request-client.js / src / api / utils.ts View on Github external
getDecimalsForCurrency(currency: RequestLogicTypes.REQUEST_LOGIC_CURRENCY): number {
    const decimals = {
      [RequestLogicTypes.REQUEST_LOGIC_CURRENCY.ETH]: 18,
      [RequestLogicTypes.REQUEST_LOGIC_CURRENCY.BTC]: 8,
    }[currency];
    if (!decimals) {
      throw new Error(`Currency ${currency} not implemented`);
    }
    return decimals;
  },
};