import { GraphQLClient as GraphQLClientClass } from 'graphql-request/dist' ; import { operationsData } from '../operations' ; import * as types from './interface' ; import Api from '../api' ; class P2P extends Api { constructor ( client ) { super ( client ) ; } getBuycoinsPrices ( opts ) { return ; } getOrdersExpiry ( opts ) { return this . query ( operationsData . getOrdersExpiry , opts ) ; } getOrders ( opts ) { return this . query ( operationsData . getOrders , opts ) ; } placeLimitOrder ( opts ) { if ( opts . priceType == "static" && ! opts . staticPrice ) { return Promise . reject ( { status : 422 , errors : "field staticPrice required when priceType is static" } ) ; } if ( opts . priceType == "dynamic" && ! opts . dynamicExchangeRate ) { return Promise . reject ( { status : 422 , errors : "field dynamicExchangeRate required when priceType is dynamic" } ) ; } return this . query ( operationsData . placeLimitOrder , opts ) ; } postMarketOrder ( opts ) { return this . query ( operationsData . postMarketOrder , opts ) ; } getMarketBook ( ) { return this . query ( operationsData . getMarketBook ) ; } } export default P2P ;