diff --git a/transaction.go b/transaction.go index 54b8a73..0c6d627 100644 --- a/transaction.go +++ b/transaction.go @@ -29,19 +29,23 @@ type Transaction struct { Score float64 Url string TimeDescription string + IsMine bool } type TransactionService struct { graphClient *graphql.Client squadservice *SquadService floorService *FloorService + + bscaddress string } -func NewTransactionService(graphClient *graphql.Client, squadservice *SquadService, floorService *FloorService) *TransactionService { +func NewTransactionService(graphClient *graphql.Client, squadservice *SquadService, floorService *FloorService, bscaddress string) *TransactionService { return &TransactionService{ graphClient: graphClient, squadservice: squadservice, floorService: floorService, + bscaddress: bscaddress, } } @@ -101,6 +105,7 @@ func (s *TransactionService) GetLightPageByLimit(ctx context.Context, pagenumber sort.Slice(transaction.Nft.TransactionHistory, func(i, j int) bool { return transaction.Nft.TransactionHistory[i].Timestamp > transaction.Nft.TransactionHistory[j].Timestamp }) + transaction.IsMine = transaction.Buyer.Address == s.bscaddress || transaction.Seller.Address == s.bscaddress } var res []Transaction