UNPKG

@gateway.fm/gtw-dvf-client-js

Version:

DVF client js lib with gateway.fm rpc endpoints

15 lines (11 loc) 366 B
const DVFError = require('../dvf/DVFError') module.exports = (dvf, symbol) => { if (!symbol) { throw new DVFError('ERR_INVALID_SYMBOL') } const from = symbol.toString().split(':')[0] const to = symbol.toString().split(':')[1] if (!dvf.token.getTokenInfo(from) || !dvf.token.getTokenInfo(to)) { throw new DVFError('ERR_INVALID_SYMBOL') } }