index

package
v0.0.0-...-6a97216 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ScanChannel chan ScanRequest

Functions

func DebugPrint

func DebugPrint(msg string, value interface{})

func FindFirstBlock

func FindFirstBlock(client *ethclient.Client, days int) (int64, error)

func GetBlockHeader

func GetBlockHeader(client *ethclient.Client, blockNumber *big.Int) (*types.Header, error)

func GetBlockTimestamp

func GetBlockTimestamp(client *ethclient.Client, blockNumber *big.Int) (time.Time, error)

func GetBlockTimestamps

func GetBlockTimestamps(client *ethclient.Client, startBlock *big.Int, endBlock *big.Int) (time.Time, time.Time, error)

func GetClient

func GetClient(ethURL string) (*ethclient.Client, error)

func GetEstimatedTimestamp

func GetEstimatedTimestamp(startTime time.Time, endTime time.Time, startBlock *big.Int, endBlock *big.Int, currentBlock *big.Int) time.Time

func ListenToEvents

func ListenToEvents(chain *model.Chain, protocol *model.Protocol, protocolInstance *model.ProtocolInstance, scannableEvents []*model.EventDefn)

func ScanHistory

func ScanHistory(client *ethclient.Client, chain *model.Chain, protocol *model.Protocol, protocolInstance *model.ProtocolInstance, scannableEvents []*model.EventDefn) error

Types

type AaveBorrowEvent

type AaveBorrowEvent struct {
	Reserve          common.Address
	User             common.Address
	OnBehalfOf       common.Address
	Amount           *big.Int
	InterestRateMode uint8
	BorrowRate       *big.Int
	ReferralCode     *big.Int
	Transaction
}

func (AaveBorrowEvent) GetBorrowAmount

func (e AaveBorrowEvent) GetBorrowAmount() *big.Int

func (AaveBorrowEvent) GetBorrowToken

func (e AaveBorrowEvent) GetBorrowToken() common.Address

func (AaveBorrowEvent) GetBorrower

func (e AaveBorrowEvent) GetBorrower() common.Address

func (AaveBorrowEvent) String

func (e AaveBorrowEvent) String() string

func (AaveBorrowEvent) Type

func (e AaveBorrowEvent) Type() string

type AaveLiquidationCallEvent

type AaveLiquidationCallEvent struct {
	CollateralAsset            common.Address
	DebtAsset                  common.Address
	User                       common.Address
	DebtToCover                *big.Int
	LiquidatedCollateralAmount *big.Int
	Liquidator                 common.Address
	ReceiveAToken              bool
	Transaction
}

func (AaveLiquidationCallEvent) GetBorrower

func (e AaveLiquidationCallEvent) GetBorrower() common.Address

func (AaveLiquidationCallEvent) GetCollateralToken

func (e AaveLiquidationCallEvent) GetCollateralToken() common.Address

func (AaveLiquidationCallEvent) GetDebtToken

func (e AaveLiquidationCallEvent) GetDebtToken() common.Address

func (AaveLiquidationCallEvent) GetLiquidator

func (e AaveLiquidationCallEvent) GetLiquidator() common.Address

func (AaveLiquidationCallEvent) GetRepayAmount

func (e AaveLiquidationCallEvent) GetRepayAmount() *big.Int

func (AaveLiquidationCallEvent) GetSeizeAmount

func (e AaveLiquidationCallEvent) GetSeizeAmount() *big.Int

func (AaveLiquidationCallEvent) String

func (e AaveLiquidationCallEvent) String() string

func (AaveLiquidationCallEvent) Type

type AaveRepay

type AaveRepay struct {
	Reserve    common.Address
	User       common.Address
	Repayer    common.Address
	Amount     *big.Int
	UseATokens bool
	Transaction
}

func (AaveRepay) GetBorrowToken

func (e AaveRepay) GetBorrowToken() common.Address

func (AaveRepay) GetBorrower

func (e AaveRepay) GetBorrower() common.Address

func (AaveRepay) GetRepayAmount

func (e AaveRepay) GetRepayAmount() *big.Int

func (AaveRepay) GetRepayer

func (e AaveRepay) GetRepayer() common.Address

func (AaveRepay) String

func (e AaveRepay) String() string

func (AaveRepay) Type

func (e AaveRepay) Type() string

type AaveSupply

type AaveSupply struct {
	Reserve      common.Address
	User         common.Address
	OnBehalfOf   common.Address
	Amount       *big.Int
	ReferralCode *big.Int
	Transaction
}

func (AaveSupply) GetDepositAmount

func (e AaveSupply) GetDepositAmount() *big.Int

func (AaveSupply) GetDepositToken

func (e AaveSupply) GetDepositToken() common.Address

func (AaveSupply) GetDepositor

func (e AaveSupply) GetDepositor() common.Address

func (AaveSupply) String

func (e AaveSupply) String() string

func (AaveSupply) Type

func (e AaveSupply) Type() string

type AaveTransferEvent

type AaveTransferEvent struct {
	From  common.Address
	To    common.Address
	Value *big.Int
	Transaction
}

func (AaveTransferEvent) String

func (e AaveTransferEvent) String() string

func (AaveTransferEvent) Type

func (e AaveTransferEvent) Type() string

type Borrowable

type Borrowable interface {
	GetBorrowAmount() *big.Int
	GetBorrower() common.Address
	GetBorrowToken() common.Address
	Typable
}

type Chain

type Chain struct {
	RpcURL         string
	BlockFetchSize int
}

type CompoundBorrowEvent

type CompoundBorrowEvent struct {
	BorrowAmount   *big.Int
	AccountBorrows *big.Int
	TotalBorrows   *big.Int
	Borrower       common.Address
	BorrowToken    common.Address
}

func (CompoundBorrowEvent) GetBorrowAmount

func (e CompoundBorrowEvent) GetBorrowAmount() *big.Int

func (CompoundBorrowEvent) GetBorrowToken

func (e CompoundBorrowEvent) GetBorrowToken() common.Address

func (CompoundBorrowEvent) GetBorrower

func (e CompoundBorrowEvent) GetBorrower() common.Address

func (CompoundBorrowEvent) String

func (e CompoundBorrowEvent) String() string

func (CompoundBorrowEvent) Type

func (e CompoundBorrowEvent) Type() string

type CompoundLiquidateBorrowEvent

type CompoundLiquidateBorrowEvent struct {
	SeizeTokens      *big.Int
	RepayAmount      *big.Int
	Liquidator       common.Address
	Borrower         common.Address
	CTokenCollateral common.Address
	DebtToken        common.Address
}

func (CompoundLiquidateBorrowEvent) GetBorrower

func (CompoundLiquidateBorrowEvent) GetCollateralToken

func (e CompoundLiquidateBorrowEvent) GetCollateralToken() common.Address

func (CompoundLiquidateBorrowEvent) GetDebtToken

func (e CompoundLiquidateBorrowEvent) GetDebtToken() common.Address

func (CompoundLiquidateBorrowEvent) GetLiquidator

func (e CompoundLiquidateBorrowEvent) GetLiquidator() common.Address

func (CompoundLiquidateBorrowEvent) GetRepayAmount

func (e CompoundLiquidateBorrowEvent) GetRepayAmount() *big.Int

func (CompoundLiquidateBorrowEvent) GetSeizeAmount

func (e CompoundLiquidateBorrowEvent) GetSeizeAmount() *big.Int

func (CompoundLiquidateBorrowEvent) String

func (CompoundLiquidateBorrowEvent) Type

type CompoundMintEvent

type CompoundMintEvent struct {
	MintAmount   *big.Int
	MintTokens   *big.Int
	Minter       common.Address
	DepositToken common.Address
}

func (CompoundMintEvent) GetDepositAmount

func (e CompoundMintEvent) GetDepositAmount() *big.Int

func (CompoundMintEvent) GetDepositToken

func (e CompoundMintEvent) GetDepositToken() common.Address

func (CompoundMintEvent) GetDepositor

func (e CompoundMintEvent) GetDepositor() common.Address

func (CompoundMintEvent) String

func (e CompoundMintEvent) String() string

func (CompoundMintEvent) Type

func (e CompoundMintEvent) Type() string

type CompoundRepayBorrowEvent

type CompoundRepayBorrowEvent struct {
	RepayAmount    *big.Int
	AccountBorrows *big.Int
	TotalBorrows   *big.Int
	Borrower       common.Address
	Payer          common.Address
	BorrowToken    common.Address
}

func (CompoundRepayBorrowEvent) GetBorrowToken

func (e CompoundRepayBorrowEvent) GetBorrowToken() common.Address

func (CompoundRepayBorrowEvent) GetBorrower

func (e CompoundRepayBorrowEvent) GetBorrower() common.Address

func (CompoundRepayBorrowEvent) GetRepayAmount

func (e CompoundRepayBorrowEvent) GetRepayAmount() *big.Int

func (CompoundRepayBorrowEvent) GetRepayer

func (e CompoundRepayBorrowEvent) GetRepayer() common.Address

func (CompoundRepayBorrowEvent) String

func (e CompoundRepayBorrowEvent) String() string

func (CompoundRepayBorrowEvent) Type

type Depositable

type Depositable interface {
	GetDepositAmount() *big.Int
	GetDepositor() common.Address
	GetDepositToken() common.Address
	Typable
}

type Liquidatable

type Liquidatable interface {
	GetSeizeAmount() *big.Int
	GetRepayAmount() *big.Int
	GetBorrower() common.Address
	GetLiquidator() common.Address
	GetDebtToken() common.Address
	GetCollateralToken() common.Address
	Typable
}

type PossibleEvent

type PossibleEvent struct {
	Borrowable   Borrowable
	Repayable    Repayable
	Liquidatable Liquidatable
	Depositable  Depositable
}

func UnpackAaveEvent

func UnpackAaveEvent(abi abi.ABI, protocolInstance *model.ProtocolInstance, eventDefn *model.EventDefn, log types.Log) (PossibleEvent, error)

func UnpackCompoundEvent

func UnpackCompoundEvent(abi abi.ABI, protocolInstance *model.ProtocolInstance, eventDefn *model.EventDefn, log types.Log) (PossibleEvent, error)

type Repayable

type Repayable interface {
	GetRepayAmount() *big.Int
	GetBorrower() common.Address
	GetBorrowToken() common.Address
	GetRepayer() common.Address
	Typable
}

type ScanRequest

type ScanRequest struct {
	Client           *ethclient.Client
	Chain            *model.Chain
	Protocol         *model.Protocol
	ProtocolInstance *model.ProtocolInstance
	ScannableEvents  []*model.EventDefn
}

type Transaction

type Transaction struct {
	TxHash string
}

func (Transaction) Txn

func (e Transaction) Txn() string

type Transactional

type Transactional interface {
	Txn() string
}

type Typable

type Typable interface {
	Type() string
}

type Unpacker

type Unpacker func(abi abi.ABI, protocolInstance *model.ProtocolInstance, eventDefn *model.EventDefn, log types.Log) (PossibleEvent, error)

Jump to

Keyboard shortcuts

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