Documentation ¶
Index ¶
- Variables
- type ERC20BalanceRepository
- func (r *ERC20BalanceRepository) CreateMetadata(ctx context.Context, chainID int64, contractAddress string, symbol string, ...) (int, error)
- func (r *ERC20BalanceRepository) FindByAddress(ctx context.Context, req *http.Request, address string, chainID string) (paginate.Page, error)
- func (r *ERC20BalanceRepository) FindMetadata(ctx context.Context, chainID int64, contractAddress string) (*eventindexer.ERC20Metadata, error)
- func (r *ERC20BalanceRepository) IncreaseAndDecreaseBalancesInTx(ctx context.Context, increaseOpts eventindexer.UpdateERC20BalanceOpts, ...) (increasedBalance *eventindexer.ERC20Balance, ...)
- type EventRepository
- func (r *EventRepository) Delete(ctx context.Context, id int) error
- func (r *EventRepository) DeleteAllAfterBlockID(ctx context.Context, blockID uint64, srcChainID uint64) error
- func (r *EventRepository) FindByEventTypeAndBlockID(ctx context.Context, eventType string, blockID int64) (*eventindexer.Event, error)
- func (r *EventRepository) FindLatestBlockID(ctx context.Context, srcChainID uint64) (uint64, error)
- func (r *EventRepository) FindUniqueProposers(ctx context.Context) ([]eventindexer.UniqueProposersResponse, error)
- func (r *EventRepository) FindUniqueProvers(ctx context.Context) ([]eventindexer.UniqueProversResponse, error)
- func (r *EventRepository) FirstByAddressAndEventName(ctx context.Context, address string, event string) (*eventindexer.Event, error)
- func (r *EventRepository) GetAssignedBlocksByProverAddress(ctx context.Context, req *http.Request, address string) (paginate.Page, error)
- func (r *EventRepository) GetBlockProposedBy(ctx context.Context, blockID int) (*eventindexer.Event, error)
- func (r *EventRepository) GetBlockProvenBy(ctx context.Context, blockID int) ([]*eventindexer.Event, error)
- func (r *EventRepository) GetByAddressAndEventName(ctx context.Context, req *http.Request, address string, event string) (paginate.Page, error)
- func (r *EventRepository) GetCountByAddressAndEventName(ctx context.Context, address string, event string) (int, error)
- func (r *EventRepository) GetTotalSlashedTokens(ctx context.Context) (*big.Int, error)
- func (r *EventRepository) Save(ctx context.Context, opts eventindexer.SaveEventOpts) (*eventindexer.Event, error)
- type NFTBalanceRepository
- func (r *NFTBalanceRepository) FindByAddress(ctx context.Context, req *http.Request, address string, chainID string) (paginate.Page, error)
- func (r *NFTBalanceRepository) IncreaseAndDecreaseBalancesInTx(ctx context.Context, increaseOpts eventindexer.UpdateNFTBalanceOpts, ...) (increasedBalance *eventindexer.NFTBalance, ...)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MockChainID = big.NewInt(167001) LatestBlockNumber = big.NewInt(10) )
Functions ¶
This section is empty.
Types ¶
type ERC20BalanceRepository ¶
type ERC20BalanceRepository struct {
ERC20Balances []*eventindexer.ERC20Balance
}
func NewERC20BalanceRepository ¶
func NewERC20BalanceRepository() *ERC20BalanceRepository
func (*ERC20BalanceRepository) CreateMetadata ¶
func (*ERC20BalanceRepository) FindByAddress ¶
func (*ERC20BalanceRepository) FindMetadata ¶
func (r *ERC20BalanceRepository) FindMetadata( ctx context.Context, chainID int64, contractAddress string, ) (*eventindexer.ERC20Metadata, error)
func (*ERC20BalanceRepository) IncreaseAndDecreaseBalancesInTx ¶
func (r *ERC20BalanceRepository) IncreaseAndDecreaseBalancesInTx( ctx context.Context, increaseOpts eventindexer.UpdateERC20BalanceOpts, decreaseOpts eventindexer.UpdateERC20BalanceOpts, ) (increasedBalance *eventindexer.ERC20Balance, decreasedBalance *eventindexer.ERC20Balance, err error)
type EventRepository ¶
type EventRepository struct {
// contains filtered or unexported fields
}
func NewEventRepository ¶
func NewEventRepository() *EventRepository
func (*EventRepository) Delete ¶
func (r *EventRepository) Delete( ctx context.Context, id int, ) error
func (*EventRepository) DeleteAllAfterBlockID ¶
func (r *EventRepository) DeleteAllAfterBlockID(ctx context.Context, blockID uint64, srcChainID uint64) error
DeleteAllAfterBlockID is used when a reorg is detected
func (*EventRepository) FindByEventTypeAndBlockID ¶
func (r *EventRepository) FindByEventTypeAndBlockID( ctx context.Context, eventType string, blockID int64) (*eventindexer.Event, error)
func (*EventRepository) FindLatestBlockID ¶
func (r *EventRepository) FindLatestBlockID( ctx context.Context, srcChainID uint64, ) (uint64, error)
GetLatestBlockID get latest block id
func (*EventRepository) FindUniqueProposers ¶
func (r *EventRepository) FindUniqueProposers( ctx context.Context, ) ([]eventindexer.UniqueProposersResponse, error)
func (*EventRepository) FindUniqueProvers ¶
func (r *EventRepository) FindUniqueProvers( ctx context.Context, ) ([]eventindexer.UniqueProversResponse, error)
func (*EventRepository) FirstByAddressAndEventName ¶
func (r *EventRepository) FirstByAddressAndEventName( ctx context.Context, address string, event string, ) (*eventindexer.Event, error)
func (*EventRepository) GetAssignedBlocksByProverAddress ¶
func (*EventRepository) GetBlockProposedBy ¶
func (r *EventRepository) GetBlockProposedBy(ctx context.Context, blockID int) (*eventindexer.Event, error)
func (*EventRepository) GetBlockProvenBy ¶
func (r *EventRepository) GetBlockProvenBy(ctx context.Context, blockID int) ([]*eventindexer.Event, error)
func (*EventRepository) GetByAddressAndEventName ¶
func (*EventRepository) GetCountByAddressAndEventName ¶
func (*EventRepository) GetTotalSlashedTokens ¶
func (*EventRepository) Save ¶
func (r *EventRepository) Save(ctx context.Context, opts eventindexer.SaveEventOpts) (*eventindexer.Event, error)
type NFTBalanceRepository ¶
type NFTBalanceRepository struct {
// contains filtered or unexported fields
}
func NewNFTBalanceRepository ¶
func NewNFTBalanceRepository() *NFTBalanceRepository
func (*NFTBalanceRepository) FindByAddress ¶
func (*NFTBalanceRepository) IncreaseAndDecreaseBalancesInTx ¶
func (r *NFTBalanceRepository) IncreaseAndDecreaseBalancesInTx( ctx context.Context, increaseOpts eventindexer.UpdateNFTBalanceOpts, decreaseOpts eventindexer.UpdateNFTBalanceOpts, ) (increasedBalance *eventindexer.NFTBalance, decreasedBalance *eventindexer.NFTBalance, err error)
Click to show internal directories.
Click to hide internal directories.