Documentation ¶
Index ¶
- Variables
- type Account
- type AccountRepository
- type Caller
- type ChartItem
- type ChartRepository
- type ChartResponse
- type ERC20Balance
- type ERC20BalanceRepository
- type ERC20Metadata
- type Event
- type EventRepository
- type NFTBalance
- type NFTBalanceRepository
- type SaveEventOpts
- type TimeSeriesData
- type Transaction
- type TransactionRepository
- type UniqueProposersResponse
- type UniqueProversResponse
- type UpdateERC20BalanceOpts
- type UpdateNFTBalanceOpts
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoEthClient = errors.Validation.NewWithKeyAndDetail("ERR_NO_ETH_CLIENT", "EthClient is required") ErrNoEventRepository = errors.Validation.NewWithKeyAndDetail( "ERR_NO_EVENT_REPOSITORY", "EventRepository is required", ) ErrNoNFTBalanceRepository = errors.Validation.NewWithKeyAndDetail( "ERR_NO_NFT_BALANCE_REPOSITORY", "NFTBalanceRepository is required", ) ErrNoStatRepository = errors.Validation.NewWithKeyAndDetail( "ERR_NO_STAT_REPOSITORY", "StatRepository is required", ) ErrNoBlockRepository = errors.Validation.NewWithKeyAndDetail( "ERR_NO_BLOCK_REPOSITORY", "BlockRepository is required", ) ErrNoCORSOrigins = errors.Validation.NewWithKeyAndDetail("ERR_NO_CORS_ORIGINS", "CORS Origins are required") ErrNoRPCClient = errors.Validation.NewWithKeyAndDetail("ERR_NO_RPC_CLIENT", "RPCClient is required") ErrInvalidMode = errors.Validation.NewWithKeyAndDetail("ERR_INVALID_MODE", "Mode not supported") ErrInvalidURL = errors.Validation.NewWithKeyAndDetail("ERR_INVALID_URL", "The provided URL is invalid or unreachable") )
View Source
var ( EventNameTransitionProved = "TransitionProved" EventNameTransitionContested = "TransitionContested" EventNameBlockProposed = "BlockProposed" EventNameBlockAssigned = "BlockAssigned" EventNameBlockVerified = "BlockVerified" EventNameMessageSent = "MessageSent" EventNameSwap = "Swap" EventNameMint = "Mint" EventNameNFTTransfer = "Transfer" EventNameInstanceAdded = "InstanceAdded" )
View Source
var ( BlockProposedEventsProcessed = promauto.NewCounter(prometheus.CounterOpts{ Name: "block_proposed_events_processed_ops_total", Help: "The total number of processed BlockProposed events", }) BlockAssignedEventsProcessed = promauto.NewCounter(prometheus.CounterOpts{ Name: "block_assigned_events_processed_ops_total", Help: "The total number of processed BlockAssigned events", }) BlockProposedEventsProcessedError = promauto.NewCounter(prometheus.CounterOpts{ Name: "block_proposed_events_processed_error_ops_total", Help: "The total number of processed BlockProposed event errors encountered", }) BlockAssignedEventsProcessedError = promauto.NewCounter(prometheus.CounterOpts{ Name: "block_assigned_events_processed_error_ops_total", Help: "The total number of processed BlockAssigned event errors encountered", }) TransitionProvedEventsProcessed = promauto.NewCounter(prometheus.CounterOpts{ Name: "block_proven_events_processed_ops_total", Help: "The total number of processed BlockProven events", }) TransitionProvedEventsProcessedError = promauto.NewCounter(prometheus.CounterOpts{ Name: "block_proven_events_processed_error_ops_total", Help: "The total number of processed BlockProven event errors encountered", }) TransitionContestedEventsProcessed = promauto.NewCounter(prometheus.CounterOpts{ Name: "block_contested_events_processed_ops_total", Help: "The total number of processed BlockContested events", }) TransitionContestedEventsProcessedError = promauto.NewCounter(prometheus.CounterOpts{ Name: "block_contested_events_processed_error_ops_total", Help: "The total number of processed BlockContested event errors encountered", }) BlockVerifiedEventsProcessed = promauto.NewCounter(prometheus.CounterOpts{ Name: "block_verified_events_processed_ops_total", Help: "The total number of processed BlockVerified events", }) BlockVerifiedEventsProcessedError = promauto.NewCounter(prometheus.CounterOpts{ Name: "block_verified_events_processed_error_ops_total", Help: "The total number of processed BlockVerified event errors encountered", }) SlashedEventsProcessed = promauto.NewCounter(prometheus.CounterOpts{ Name: "slashed_events_processed_ops_total", Help: "The total number of processed Slashed events", }) SlashedEventsProcessedError = promauto.NewCounter(prometheus.CounterOpts{ Name: "slashed_events_processed_error_ops_total", Help: "The total number of processed Slashed event errors encountered", }) StakedEventsProcessed = promauto.NewCounter(prometheus.CounterOpts{ Name: "staked_events_processed_ops_total", Help: "The total number of processed Staked events", }) StakedEventsProcessedError = promauto.NewCounter(prometheus.CounterOpts{ Name: "staked_events_processed_error_ops_total", Help: "The total number of processed Staked event errors encountered", }) ExitedEventsProcessed = promauto.NewCounter(prometheus.CounterOpts{ Name: "exited_events_processed_ops_total", Help: "The total number of processed Exited events", }) ExitedEventsProcessedError = promauto.NewCounter(prometheus.CounterOpts{ Name: "exited_events_processed_error_ops_total", Help: "The total number of processed Exited event errors encountered", }) WithdrawnEventsProcessed = promauto.NewCounter(prometheus.CounterOpts{ Name: "withdrawn_events_processed_ops_total", Help: "The total number of processed Exited events", }) WithdrawnEventsProcessedError = promauto.NewCounter(prometheus.CounterOpts{ Name: "withdrawn_events_processed_error_ops_total", Help: "The total number of processed Exited event errors encountered", }) MessageSentEventsProcessed = promauto.NewCounter(prometheus.CounterOpts{ Name: "message_sent_events_processed_ops_total", Help: "The total number of processed MessageSent events", }) MessageSentEventsProcessedError = promauto.NewCounter(prometheus.CounterOpts{ Name: "message_sent_events_processed_error_ops_total", Help: "The total number of processed MessageSent event errors encountered", }) SwapEventsProcessed = promauto.NewCounter(prometheus.CounterOpts{ Name: "swap_events_processed_ops_total", Help: "The total number of processed Swap events", }) SwapEventsProcessedError = promauto.NewCounter(prometheus.CounterOpts{ Name: "swap_events_processed_error_ops_total", Help: "The total number of processed Swap event errors encountered", }) LiquidityAddedEventsProcessed = promauto.NewCounter(prometheus.CounterOpts{ Name: "liquidity_added_events_processed_ops_total", Help: "The total number of processed LiquidityAdded events", }) LiquidityAddedEventsProcessedError = promauto.NewCounter(prometheus.CounterOpts{ Name: "liquidity_added_events_processed_error_ops_total", Help: "The total number of processed LiquidityAdded event errors encountered", }) BlocksProcessed = promauto.NewCounter(prometheus.CounterOpts{ Name: "blocks_processed_ops_total", Help: "The total number of processed blocks", }) ErrorsEncounteredDuringSubscription = promauto.NewCounter(prometheus.CounterOpts{ Name: "errors_encountered_during_subscription_opts_total", Help: "The total number of errors that occurred during active subscription", }) )
Functions ¶
This section is empty.
Types ¶
type AccountRepository ¶
type ChartRepository ¶
type ChartResponse ¶
type ChartResponse struct {
Chart []ChartItem `json:"chart"`
}
type ERC20Balance ¶
type ERC20Balance struct { ID int `json:"id"` ERC20MetadataID int64 `json:"erc20MetadataID"` ChainID int64 `json:"chainID"` Address string `json:"address"` Amount string `json:"amount"` ContractAddress string `json:"contractAddress"` Metadata *ERC20Metadata `json:"metadata" gorm:"foreignKey:ERC20MetadataID"` }
ERC20Balance
type ERC20BalanceRepository ¶
type ERC20BalanceRepository interface { IncreaseAndDecreaseBalancesInTx( ctx context.Context, increaseOpts UpdateERC20BalanceOpts, decreaseOpts UpdateERC20BalanceOpts, ) (increasedBalance *ERC20Balance, decreasedBalance *ERC20Balance, err error) FindByAddress(ctx context.Context, req *http.Request, address string, chainID string, ) (paginate.Page, error) FindMetadata(ctx context.Context, chainID int64, contractAddress string) (*ERC20Metadata, error) CreateMetadata( ctx context.Context, chainID int64, contractAddress string, symbol string, decimals uint8, ) (int, error) }
ERC20BalanceRepository is used to interact with nft balances in the store
type ERC20Metadata ¶
type Event ¶
type Event struct { ID int `json:"id"` Name string `json:"name"` Data datatypes.JSON `json:"data"` ChainID int64 `json:"chainID"` Event string `json:"event"` Address string `json:"address"` BlockID sql.NullInt64 `json:"blockID"` Amount decimal.NullDecimal `json:"amount"` ProofReward decimal.NullDecimal `json:"proofReward"` ProposerReward decimal.NullDecimal `json:"proposerReward"` AssignedProver string `json:"assignedProver"` To string `json:"to"` TokenID sql.NullInt64 `json:"tokenID"` ContractAddress string `json:"contractAddress"` FeeTokenAddress string `json:"feeTokenAddress"` TransactedAt time.Time `json:"transactedAt"` Tier sql.NullInt16 `json:"tier"` EmittedBlockID uint64 `json:"emittedBlockID"` }
Event represents a stored EVM event. The fields will be serialized into the Data field to be unmarshalled into a concrete struct dependant on the name of the event
type EventRepository ¶
type EventRepository interface { Save(ctx context.Context, opts SaveEventOpts) (*Event, error) FindUniqueProvers( ctx context.Context, ) ([]UniqueProversResponse, error) FindUniqueProposers( ctx context.Context, ) ([]UniqueProposersResponse, error) FindByEventTypeAndBlockID( ctx context.Context, eventType string, blockID int64) (*Event, error) Delete( ctx context.Context, id int, ) error GetCountByAddressAndEventName(ctx context.Context, address string, event string) (int, error) GetByAddressAndEventName( ctx context.Context, req *http.Request, address string, event string, ) (paginate.Page, error) FirstByAddressAndEventName( ctx context.Context, address string, event string, ) (*Event, error) GetAssignedBlocksByProverAddress( ctx context.Context, req *http.Request, address string, ) (paginate.Page, error) DeleteAllAfterBlockID(ctx context.Context, blockID uint64, srcChainID uint64) error FindLatestBlockID( ctx context.Context, srcChainID uint64, ) (uint64, error) GetBlockProvenBy(ctx context.Context, blockID int) ([]*Event, error) GetBlockProposedBy(ctx context.Context, blockID int) (*Event, error) }
EventRepository is used to interact with events in the store
type NFTBalance ¶
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"` }
NFTBalance represents a single contractAddress/tokenId pairing for a given holder address
type NFTBalanceRepository ¶
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) }
NFTBalanceRepository is used to interact with nft balances in the store
type SaveEventOpts ¶
type SaveEventOpts struct { Name string Data string ChainID *big.Int Event string Address string BlockID *int64 Amount *big.Int ProposerReward *big.Int ProofReward *big.Int AssignedProver *string To *string TokenID *int64 ContractAddress *string FeeTokenAddress *string TransactedAt time.Time Tier *uint16 EmittedBlockID uint64 }
SaveEventOpts
type TimeSeriesData ¶
type Transaction ¶
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 ¶
type UniqueProposersResponse ¶
type UniqueProversResponse ¶
type UpdateERC20BalanceOpts ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.