forked from taikoxyz/taiko-mono
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nft_balance.go
40 lines (35 loc) · 1.07 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
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 {
SubtractBalance(ctx context.Context, opts UpdateNFTBalanceOpts) (*NFTBalance, error)
IncreaseBalance(ctx context.Context, opts UpdateNFTBalanceOpts) (*NFTBalance, error)
FindByAddress(ctx context.Context,
req *http.Request,
address string,
chainID string,
) (paginate.Page, error)
}