forked from taikoxyz/taiko-mono
-
Notifications
You must be signed in to change notification settings - Fork 0
/
transaction.go
33 lines (29 loc) · 915 Bytes
/
transaction.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
package eventindexer
import (
"context"
"math/big"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/shopspring/decimal"
)
type Transaction struct {
ID int `json:"id"`
ChainID int64 `json:"chainID"`
Sender string `json:"sender"`
Recipient string `json:"recipient"`
BlockID int64 `json:"blockID"`
Amount decimal.NullDecimal `json:"amount"`
GasPrice string `json:"gasPrice"`
TransactedAt time.Time `json:"transactedAt"`
ContractAddress string `json:"contractAddress"`
}
type TransactionRepository interface {
Save(
ctx context.Context,
tx *types.Transaction,
sender common.Address,
blockID *big.Int,
timestamp time.Time,
contractAddress common.Address) error
}