Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Commit

Permalink
[#1571] Update GETTransactions endpoint to use repo.APITime
Browse files Browse the repository at this point in the history
Also:
- extract chat models into repo/chat_message.go
- make repo.APITime a struct that embeds a time to get free access to
  time.Time methods
  • Loading branch information
placer14 committed May 22, 2019
1 parent e2fa05f commit a548d42
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions api/jsonapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -2867,18 +2867,18 @@ func (i *jsonAPIHandler) GETTransactions(w http.ResponseWriter, r *http.Request)
}
offsetID := r.URL.Query().Get("offsetId")
type Tx struct {
Txid string `json:"txid"`
Value int64 `json:"value"`
Address string `json:"address"`
Status string `json:"status"`
ErrorMessage string `json:"errorMessage"`
Memo string `json:"memo"`
Timestamp time.Time `json:"timestamp"`
Confirmations int32 `json:"confirmations"`
Height int32 `json:"height"`
OrderID string `json:"orderId"`
Thumbnail string `json:"thumbnail"`
CanBumpFee bool `json:"canBumpFee"`
Txid string `json:"txid"`
Value int64 `json:"value"`
Address string `json:"address"`
Status string `json:"status"`
ErrorMessage string `json:"errorMessage"`
Memo string `json:"memo"`
Timestamp *repo.APITime `json:"timestamp"`
Confirmations int32 `json:"confirmations"`
Height int32 `json:"height"`
OrderID string `json:"orderId"`
Thumbnail string `json:"thumbnail"`
CanBumpFee bool `json:"canBumpFee"`
}
wal, err := i.node.Multiwallet.WalletForCurrencyCode(coinType)
if err != nil {
Expand All @@ -2902,7 +2902,7 @@ func (i *jsonAPIHandler) GETTransactions(w http.ResponseWriter, r *http.Request)
tx := Tx{
Txid: t.Txid,
Value: t.Value,
Timestamp: t.Timestamp,
Timestamp: repo.NewAPITime(t.Timestamp),
Confirmations: int32(t.Confirmations),
Height: t.Height,
Status: string(t.Status),
Expand Down

0 comments on commit a548d42

Please sign in to comment.