// GetTrades returns a pointer to a Trades struct with the data given
// by the api and an error message. It returns (nil, error) when an error
// is raised and (*Trades, nil) when the operation is successful.
// The data fields are MarketTaker, Price, Amount, Tid, Timestamp and Market.
// You can access them by *Trades.Data[indexYouWant].FieldYouWant
//
// List of accepted Arguments:
//   - required: Market (string)
//   - optional: Start (string YYYY-MM-DD), End (YYYY-MM-DD), Page (int), Limit (int)
// https://developers.cryptomkt.com/#trades
GetTrades returns a pointer to a Trades struct with the data given
by the api and an error message. It returns (nil, error) when an error
is raised and (*Trades, nil) when the operation is successful.
The data fields are MarketTaker, Price, Amount, Tid, Timestamp and Market.
You can access them by *Trades.Data[indexYouWant].FieldYouWant


// GetTrades returns a pointer to a Trades struct with the data given // by the api and an error message . It returns ( nil error ) when an error // is raised and ( * Trades nil ) when the operation is successful . // The data fields are MarketTaker Price Amount Tid Timestamp and Market . // You can access them by * Trades . Data [ indexYouWant ] . FieldYouWant // // List of accepted Arguments : // - required : Market ( string ) // - optional : Start ( string YYYY - MM - DD ) End ( YYYY - MM - DD ) Page ( int ) Limit ( int ) // https : // developers . cryptomkt . com / #trades
func (client *Client) GetTrades(arguments ...args.Argument) (*Trades, error) {
	required := []string{"market"}
	req, err := makeReq(required, arguments...)
	if err != nil {
		return nil, fmt.Errorf("Error in GetTrades: %s", err)
	}
	resp, err := client.getPublic("trades", req)
	if err != nil {
		return nil, fmt.Errorf("error making the request: %s", err)
	}
	var tResp TradesResponse
	json.Unmarshal(resp, &tResp)
	if tResp.Status == "error" {
		return nil, fmt.Errorf("error from the server side: %s", tResp.Message)
	}
	trades := Trades{
		args:       req.GetArguments(),
		pagination: tResp.Pagination,
		client:     client,
		Data:       tResp.Data,
	}
	return &trades, nil
}
func ( client * Client ) GetTrades ( arguments ... args . Argument ) ( * Trades , error ) { required := [ ] string { " " } req , err := makeReq ( required , arguments ... ) if err != nil { return nil , fmt . Errorf ( " " , err ) } resp , err := client . getPublic ( " " , req ) if err != nil { return nil , fmt . Errorf ( " " , err ) } var tResp TradesResponse json . Unmarshal ( resp , & tResp ) if tResp . Status == " " { return nil , fmt . Errorf ( " " , tResp . Message ) } trades := Trades { args : req . GetArguments ( ) , pagination : tResp . Pagination , client : client , Data : tResp . Data , } return & trades , nil }
GetTrades returns a pointer to a Trades struct with the data given
by the api and an error message.
GetTrades returns a pointer to a Trades struct with the data given by the api and an error message .