Compare commits
No commits in common. "1a4ee0d3e1f322f296321f124b490ec14824a53c" and "43892f0d8c30e01040051f8548528d2f8ac7af5d" have entirely different histories.
1a4ee0d3e1
...
43892f0d8c
@ -84,18 +84,18 @@ func GetTransferData(ctx context.Context, db storage.PrefixDb, publicKey string,
|
|||||||
|
|
||||||
// Adjust for 0-based indexing
|
// Adjust for 0-based indexing
|
||||||
i := index - 1
|
i := index - 1
|
||||||
transactionType := "Received"
|
transactionType := "received"
|
||||||
party := fmt.Sprintf("From: %s", strings.TrimSpace(senders[i]))
|
party := fmt.Sprintf("from: %s", strings.TrimSpace(senders[i]))
|
||||||
if strings.TrimSpace(senders[i]) == publicKey {
|
if strings.TrimSpace(senders[i]) == publicKey {
|
||||||
transactionType = "Sent"
|
transactionType = "sent"
|
||||||
party = fmt.Sprintf("To: %s", strings.TrimSpace(recipients[i]))
|
party = fmt.Sprintf("to: %s", strings.TrimSpace(recipients[i]))
|
||||||
}
|
}
|
||||||
|
|
||||||
formattedDate := formatDate(strings.TrimSpace(dates[i]))
|
formattedDate := formatDate(strings.TrimSpace(dates[i]))
|
||||||
|
|
||||||
// Build the full transaction detail
|
// Build the full transaction detail
|
||||||
detail := fmt.Sprintf(
|
detail := fmt.Sprintf(
|
||||||
"%s %s %s\n%s\nContract address: %s\nTxhash: %s\nDate: %s",
|
"%s %s %s\n%s\ncontract address: %s\ntxhash: %s\ndate: %s",
|
||||||
transactionType,
|
transactionType,
|
||||||
strings.TrimSpace(values[i]),
|
strings.TrimSpace(values[i]),
|
||||||
strings.TrimSpace(syms[i]),
|
strings.TrimSpace(syms[i]),
|
||||||
|
|||||||
@ -1846,7 +1846,7 @@ func (h *Handlers) CheckTransactions(ctx context.Context, sym string, input []by
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetTransactionsList reads the list of transactions from the db and formats them
|
// GetTransactionsList fetches the list of transactions and formats them
|
||||||
func (h *Handlers) GetTransactionsList(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
func (h *Handlers) GetTransactionsList(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
||||||
var res resource.Result
|
var res resource.Result
|
||||||
sessionId, ok := ctx.Value("SessionId").(string)
|
sessionId, ok := ctx.Value("SessionId").(string)
|
||||||
@ -1895,9 +1895,9 @@ func (h *Handlers) GetTransactionsList(ctx context.Context, sym string, input []
|
|||||||
value := strings.TrimSpace(values[i])
|
value := strings.TrimSpace(values[i])
|
||||||
date := strings.Split(strings.TrimSpace(dates[i]), " ")[0]
|
date := strings.Split(strings.TrimSpace(dates[i]), " ")[0]
|
||||||
|
|
||||||
status := "Received"
|
status := "received"
|
||||||
if sender == string(publicKey) {
|
if sender == string(publicKey) {
|
||||||
status = "Sent"
|
status = "sent"
|
||||||
}
|
}
|
||||||
|
|
||||||
formattedTransactions = append(formattedTransactions, fmt.Sprintf("%d:%s %s %s %s", i+1, status, value, sym, date))
|
formattedTransactions = append(formattedTransactions, fmt.Sprintf("%d:%s %s %s %s", i+1, status, value, sym, date))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user