repo

package
v0.3.1-0...-684a909 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ZeroAddress = common.HexToAddress("0x0000000000000000000000000000000000000000")
)

Functions

This section is empty.

Types

type AccountRepository

type AccountRepository struct {
	// contains filtered or unexported fields
}

func NewAccountRepository

func NewAccountRepository(dbHandler db.DB) (*AccountRepository, error)

func (*AccountRepository) Save

func (r *AccountRepository) Save(
	ctx context.Context,
	address common.Address,
	transactedAt time.Time,
) error

type ChartRepository

type ChartRepository struct {
	// contains filtered or unexported fields
}

func NewChartRepository

func NewChartRepository(dbHandler db.DB) (*ChartRepository, error)

func (*ChartRepository) Find

func (r *ChartRepository) Find(
	ctx context.Context,
	task string,
	start string,
	end string,
	feeTokenAddress string,
	tier string,
) (*eventindexer.ChartResponse, error)

type ERC20BalanceRepository

type ERC20BalanceRepository struct {
	// contains filtered or unexported fields
}

func NewERC20BalanceRepository

func NewERC20BalanceRepository(dbHandler db.DB) (*ERC20BalanceRepository, error)

func (*ERC20BalanceRepository) CreateMetadata

func (r *ERC20BalanceRepository) CreateMetadata(
	ctx context.Context,
	chainID int64,
	contractAddress string,
	symbol string,
	decimals uint8,
) (int, error)

func (*ERC20BalanceRepository) FindByAddress

func (r *ERC20BalanceRepository) FindByAddress(ctx context.Context,
	req *http.Request,
	address string,
	chainID string,
) (paginate.Page, error)

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(dbHandler db.DB) (*EventRepository, error)

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 (r *EventRepository) GetAssignedBlocksByProverAddress(
	ctx context.Context,
	req *http.Request,
	address string,
) (paginate.Page, error)

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 (r *EventRepository) GetByAddressAndEventName(
	ctx context.Context,
	req *http.Request,
	address string,
	event string,
) (paginate.Page, error)

func (*EventRepository) GetCountByAddressAndEventName

func (r *EventRepository) GetCountByAddressAndEventName(
	ctx context.Context,
	address string,
	event string,
) (int, error)

func (*EventRepository) Save

type NFTBalanceRepository

type NFTBalanceRepository struct {
	// contains filtered or unexported fields
}

func NewNFTBalanceRepository

func NewNFTBalanceRepository(dbHandler db.DB) (*NFTBalanceRepository, error)

func (*NFTBalanceRepository) FindByAddress

func (r *NFTBalanceRepository) FindByAddress(ctx context.Context,
	req *http.Request,
	address string,
	chainID string,
) (paginate.Page, error)

func (*NFTBalanceRepository) IncreaseAndDecreaseBalancesInTx

func (r *NFTBalanceRepository) IncreaseAndDecreaseBalancesInTx(
	ctx context.Context,
	increaseOpts eventindexer.UpdateNFTBalanceOpts,
	decreaseOpts eventindexer.UpdateNFTBalanceOpts,
) (increasedBalance *eventindexer.NFTBalance, decreasedBalance *eventindexer.NFTBalance, err error)

type TransactionRepository

type TransactionRepository struct {
	// contains filtered or unexported fields
}

func NewTransactionRepository

func NewTransactionRepository(dbHandler db.DB) (*TransactionRepository, error)

func (*TransactionRepository) Save

func (r *TransactionRepository) Save(
	ctx context.Context,
	tx *types.Transaction,
	sender common.Address,
	blockID *big.Int,
	transactedAt time.Time,
	contractAddress common.Address,
) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL