@gateway.fm/gtw-dvf-client-js
Version:
DVF client js lib with gateway.fm rpc endpoints
23 lines (19 loc) • 654 B
JavaScript
const { Joi } = require('dvf-utils')
const get = require('../lib/dvf/get-authenticated')
const validateWithJoi = require('../lib/validators/validateWithJoi')
const schema = Joi.object({
feature: Joi.string(),
symbol: Joi.string()
})
const validateArg0 = validateWithJoi(schema, { presence: 'optional' })('INVALID_METHOD_ARGUMENT')({
context: `getFeeRate`
})
const endpoint = '/v1/trading/r/feeRate'
/**
*
* Retrieve feeRate based on deversifi feeRate rules
*/
module.exports = async (dvf, data, nonce, signature) => {
const { feature, symbol } = validateArg0(data || {})
return get(dvf, endpoint, nonce, signature, { feature, symbol })
}