UNPKG

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

Version:

DVF client js lib with gateway.fm rpc endpoints

20 lines (14 loc) 566 B
const post = require('../lib/dvf/post-authenticated') const extractOrderIdsInput = require('../lib/util/extractOrderIdsInput') const validateAssertions = require('../lib/validators/validateAssertions') /** * * @param {Object} orderIdOrCid 'xxx' or { orderId: 'xxx' } or { cid: 'yyy' } */ module.exports = async (dvf, orderIdOrCid, nonce, signature) => { const input = extractOrderIdsInput(orderIdOrCid) validateAssertions(dvf, input) const endpoint = '/v1/trading/r/getOrder' const data = input return post(dvf, endpoint, nonce, signature, data) }