forked from taikoxyz/taiko-mono
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nft_balance.go
43 lines (38 loc) · 1.1 KB
/
nft_balance.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
40
41
42
43
package eventindexer
import (
"context"
"net/http"
"github.com/morkid/paginate"
)
// NFTBalance represents a single contractAddress/tokenId pairing for a given holder
// address
type NFTBalance struct {
ID int `json:"id"`
ChainID int64 `json:"chainID"`
Address string `json:"address"`
Amount int64 `json:"amount"`
TokenID int64 `json:"tokenID"`
ContractAddress string `json:"contractAddress"`
ContractType string `json:"contractType"`
}
type UpdateNFTBalanceOpts struct {
ChainID int64
Address string
TokenID int64
ContractAddress string
ContractType string
Amount int64
}
// NFTBalanceRepository is used to interact with nft balances in the store
type NFTBalanceRepository interface {
IncreaseAndDecreaseBalancesInTx(
ctx context.Context,
increaseOpts UpdateNFTBalanceOpts,
decreaseOpts UpdateNFTBalanceOpts,
) (increasedBalance *NFTBalance, decreasedBalance *NFTBalance, err error)
FindByAddress(ctx context.Context,
req *http.Request,
address string,
chainID string,
) (paginate.Page, error)
}