schema

package
v0.0.0-...-8c125ef Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BillingCollectDataPerAddress

type BillingCollectDataPerAddress struct {
	Ru          int64
	BillingRate float64
}

type BillingRecordBase

type BillingRecordBase struct {
	CreatedAt time.Time
	UpdatedAt time.Time

	TxHash         common.Hash
	Index          uint
	ChainID        uint64
	BlockTimestamp time.Time
	BlockNumber    *big.Int

	User   common.Address
	Amount *big.Int
}

func BillingRecordParseBase

func BillingRecordParseBase(chainID uint64, header *types.Header, transaction *types.Transaction, logIndex uint, user common.Address, amount *big.Int) BillingRecordBase

type BillingRecordCollected

type BillingRecordCollected struct {
	BillingRecordBase
}

type BillingRecordDeposited

type BillingRecordDeposited struct {
	BillingRecordBase
}

type BillingRecordWithdrawal

type BillingRecordWithdrawal struct {
	BillingRecordBase

	Fee *big.Int
}

type Checkpoint

type Checkpoint struct {
	ChainID     uint64      `json:"network"`
	BlockNumber uint64      `json:"block_number"`
	BlockHash   common.Hash `json:"block_hash"`
}

type CheckpointExporter

type CheckpointExporter interface {
	Export() (*Checkpoint, error)
}

type CheckpointImporter

type CheckpointImporter interface {
	Import(checkpoint Checkpoint) error
}

type CheckpointTransformer

type CheckpointTransformer interface {
	CheckpointImporter
	CheckpointExporter
}

type DistributeRewardsData

type DistributeRewardsData struct {
	Epoch            *big.Int         `json:"epoch"`
	NodeAddress      []common.Address `json:"nodeAddrs"`
	OperationRewards []*big.Int       `json:"operationRewards"`
	IsFinal          bool             `json:"isFinal"`
}

type Epoch

type Epoch struct {
	ID                    uint64       `json:"id"`
	StartTimestamp        int64        `json:"startTimestamp"`
	EndTimestamp          int64        `json:"endTimestamp"`
	TransactionHash       common.Hash  `json:"transactionHash"`
	TransactionIndex      uint         `json:"transactionIndex"`
	BlockHash             common.Hash  `json:"blockHash"`
	BlockNumber           *big.Int     `json:"blockNumber"`
	BlockTimestamp        int64        `json:"blockTimestamp"`
	TotalOperationRewards string       `json:"totalOperationRewards"`
	TotalStakingRewards   string       `json:"totalStakingRewards"`
	TotalRewardItems      int          `json:"totalRewardItems"`
	RewardItems           []*EpochItem `json:"rewardItems,omitempty"`
	CreatedAt             int64        `json:"-"`
	UpdatedAt             int64        `json:"-"`
}

type EpochItem

type EpochItem struct {
	EpochID          uint64         `json:"epochID"`
	Index            int            `json:"index"`
	TransactionHash  common.Hash    `json:"transactionHash"`
	NodeAddress      common.Address `json:"nodeAddress"`
	OperationRewards string         `json:"operationRewards"`
	StakingRewards   string         `json:"stakingRewards"`
	TaxAmounts       string         `json:"taxAmounts"`
}

type EpochTrigger

type EpochTrigger struct {
	TransactionHash common.Hash           `json:"transactionHash"`
	EpochID         uint64                `json:"epochID"`
	Data            DistributeRewardsData `json:"data"`
	CreatedAt       time.Time             `json:"createdAt"`
	UpdatedAt       time.Time             `json:"updatedAt"`
}

type NodeRequestRecord

type NodeRequestRecord struct {
	NodeAddress  common.Address
	Epoch        *big.Int
	RequestCount *big.Int

	RequestReward *big.Int
}

type UsageByDate

type UsageByDate struct {
	RuUsed               int64 `gorm:"column:ru_used"`
	APICalls             int64 `gorm:"column:api_calls"`
	ConsumptionTimestamp int64 `gorm:"column:consumption_timestamp"`
}

Jump to

Keyboard shortcuts

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