UNPKG

dvf-client-js

Version:

<img src="https://avatars1.githubusercontent.com/u/56512535?s=200&v=4" align="right" />

20 lines (15 loc) 579 B
const { Joi } = require('dvf-utils') const postGeneric = require('../lib/dvf/post-generic') const validateWithJoi = require('../lib/validators/validateWithJoi') const schema = Joi.object({ walletType: Joi.string(), successText: Joi.string() }) const validateData = validateWithJoi(schema)('INVALID_METHOD_ARGUMENT')({ context: 'walletSuccessEvent' }) module.exports = async (dvf, data) => { const endpoint = '/v1/trading/w/walletSuccessEvent' const { walletType, successText } = validateData(data) return postGeneric(dvf, endpoint, { walletType, successText }) }