-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_trades_for_offering.go
39 lines (34 loc) · 1.53 KB
/
get_trades_for_offering.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package transactapi
import (
"net/http"
)
type GetTradesForOfferingRequest struct {
ClientID string `json:"clientID"`
DeveloperApiKey string `json:"developerAPIKey"`
OfferingID string `json:"offeringId"`
}
type GetTradesForOfferingResponse struct {
StatusCode string `json:"statusCode"`
StatusDesc string `json:"statusDesc"`
OfferingPurchasedDetails []offeringPurchaseHistory `json:"Offering purchased details"`
}
type offeringPurchaseHistory struct {
TradeID string `json:"tradeId"`
AccountID string `json:"accountId"`
OfferingID string `json:"offeringId"`
TotalAmount string `json:"totalAmount"`
TotalShares string `json:"totalShares"`
PurchaseDate string `json:"purchaseDate"`
AccountName string `json:"accountName"`
OfferingTotalShares string `json:"offeringTotalShares"`
TargetAmount string `json:"targetAmount"`
RemainingShares string `json:"remainingShares"`
}
// This method is used to retrieve the history of all trades (and details of the trades) created
// for an offering. The Offering ID is required as a request parameter to fetch the purchase
// history.
//
// Reference: https://transactapi.readme.io/reference/gettradesforoffering
func (c *Client) GetTradesForOffering(req *GetTradesForOfferingRequest) (*GetTradesForOfferingResponse, error) {
return request[GetTradesForOfferingRequest, GetTradesForOfferingResponse](c, http.MethodPost, EndpointGetTradesForOffering, req)
}