Documentation
¶
Index ¶
- Variables
- type Adapter
- type AdapterListener
- type Address
- type BCType
- type Callback
- type Callbacks
- type Contract
- type Event
- type Harvester2
- func (h *Harvester2) AddNFTContract(bcType BCType, contract Address) error
- func (h *Harvester2) AddNFTListener(bcType BCType, contract Address, event string, listener NFTListener) error
- func (h *Harvester2) AddStakeContract(bcType BCType, contract Address) error
- func (h *Harvester2) AddStakeListener(bcType BCType, contract Address, listener StakeListener) error
- func (h *Harvester2) AddTokenContract(bcType BCType, contract Address) error
- func (h *Harvester2) AddTokenListener(bcType BCType, contract Address, event string, listener TokenListener) error
- func (h *Harvester2) AddWallet(bcType BCType, wallet Address) error
- func (h *Harvester2) Display(bcType BCType)
- func (h *Harvester2) GetWalletNFTData(bcType BCType, contract Address, wallet Address) (*NFTData, error)
- func (h *Harvester2) GetWalletTokenData(bcType BCType, contract Address, wallet Address) (*TokenData, error)
- func (h *Harvester2) RegisterAdapter(adapter Adapter) error
- func (h *Harvester2) RemoveNFTContract(bcType BCType, contract Address) error
- func (h *Harvester2) RemoveStakeContract(bcType BCType, contract Address) error
- func (h *Harvester2) RemoveTokenContract(bcType BCType, contract Address) error
- func (h *Harvester2) RemoveWallet(bcType BCType, wallet Address) error
- type IHarvester2
- type Matrix
- func (m *Matrix) AddNFTContract(contract Address) error
- func (m *Matrix) AddNFTListener(contract Address, event string, listener NFTListener) error
- func (m *Matrix) AddStakeContract(contract Address) error
- func (m *Matrix) AddTokenContract(contract Address) error
- func (m *Matrix) AddTokenListener(contract Address, event string, listener TokenListener) error
- func (m *Matrix) AddWallet(wallet Address) error
- func (m *Matrix) Display()
- func (m *Matrix) GetWalletNFTData(contract Address, wallet Address) (*NFTData, error)
- func (m *Matrix) GetWalletTokenData(contract Address, wallet Address) (*TokenData, error)
- func (m *Matrix) ProcessLogs(blockNumber uint64, logs []any)
- func (m *Matrix) Run()
- type NFTCell
- type NFTData
- type NFTListener
- type NftEvent
- type RestakeLog
- type Stake
- type StakeCell
- type StakeData
- type StakeEvent
- type StakeListener
- type StakeLog
- type TokenCell
- type TokenData
- type TokenListener
- type TransferERC20Log
- type TransferNFTLog
- type UnstakeLog
- type UpdateEvent
- type Wallet
Constants ¶
This section is empty.
Variables ¶
View Source
var ZeroAddress = common.Address{}
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter interface {
GetLastBlockNumber() (uint64, error)
GetBalance(wallet *common.Address, contract *common.Address, blockNumber uint64) (*big.Int, error)
GetNFTBalance(block int64, wallet *common.Address, nftContract *common.Address) ([]umid.UMID, error)
GetStakeBalance(block int64, wallet *common.Address, nftContract *common.Address) (map[umid.UMID]*[3]*big.Int, error)
GetLogs(fromBlock, toBlock int64, addresses []common.Address) ([]any, error)
RegisterNewBlockListener(f AdapterListener)
Run()
GetInfo() (umid umid.UMID, name BCType, rpcURL string)
}
type AdapterListener ¶
type AdapterListener func(blockNumber uint64)
type Callbacks ¶
func NewCallbacks ¶
func NewCallbacks() *Callbacks
type Harvester2 ¶
type Harvester2 struct {
// contains filtered or unexported fields
}
func NewHarvester ¶
func NewHarvester(db *pgxpool.Pool) *Harvester2
func (*Harvester2) AddNFTContract ¶
func (h *Harvester2) AddNFTContract(bcType BCType, contract Address) error
func (*Harvester2) AddNFTListener ¶
func (h *Harvester2) AddNFTListener(bcType BCType, contract Address, event string, listener NFTListener) error
func (*Harvester2) AddStakeContract ¶
func (h *Harvester2) AddStakeContract(bcType BCType, contract Address) error
func (*Harvester2) AddStakeListener ¶
func (h *Harvester2) AddStakeListener(bcType BCType, contract Address, listener StakeListener) error
func (*Harvester2) AddTokenContract ¶
func (h *Harvester2) AddTokenContract(bcType BCType, contract Address) error
func (*Harvester2) AddTokenListener ¶
func (h *Harvester2) AddTokenListener(bcType BCType, contract Address, event string, listener TokenListener) error
func (*Harvester2) Display ¶
func (h *Harvester2) Display(bcType BCType)
func (*Harvester2) GetWalletNFTData ¶
func (*Harvester2) GetWalletTokenData ¶
func (*Harvester2) RegisterAdapter ¶
func (h *Harvester2) RegisterAdapter(adapter Adapter) error
func (*Harvester2) RemoveNFTContract ¶
func (h *Harvester2) RemoveNFTContract(bcType BCType, contract Address) error
func (*Harvester2) RemoveStakeContract ¶
func (h *Harvester2) RemoveStakeContract(bcType BCType, contract Address) error
func (*Harvester2) RemoveTokenContract ¶
func (h *Harvester2) RemoveTokenContract(bcType BCType, contract Address) error
func (*Harvester2) RemoveWallet ¶
func (h *Harvester2) RemoveWallet(bcType BCType, wallet Address) error
type IHarvester2 ¶
type IHarvester2 interface {
RegisterAdapter(adapter Adapter)
AddWallet(bcType BCType, wallet Address) error
RemoveWallet(bcType BCType, wallet Address) error
AddNFTContract(bcType BCType, contract Address) error
RemoveNFTContract(bcType BCType, contract Address) error
AddTokenContract(bcType BCType, contract Address) error
RemoveTokenContract(bcType BCType, contract Address) error
AddTokenListener(bcType BCType, contract Address, listener TokenListener) error
AddNFTListener(bcType BCType, contract Address, listener NFTListener) error
AddStakeListener(bcType BCType, contract Address, listener StakeListener) error
GetWalletTokenData(bcType BCType, contract Address, wallet Address) (*TokenData, error)
GetWalletNFTData(bcType BCType, contract Address, wallet Address) (*NFTData, error)
}
type Matrix ¶
type Matrix struct {
// contains filtered or unexported fields
}
func (*Matrix) AddNFTContract ¶
func (*Matrix) AddNFTListener ¶
func (m *Matrix) AddNFTListener(contract Address, event string, listener NFTListener) error
func (*Matrix) AddStakeContract ¶
func (*Matrix) AddTokenContract ¶
func (*Matrix) AddTokenListener ¶
func (m *Matrix) AddTokenListener(contract Address, event string, listener TokenListener) error
func (*Matrix) GetWalletNFTData ¶
func (*Matrix) GetWalletTokenData ¶
func (*Matrix) ProcessLogs ¶
type NFTListener ¶
type NFTListener func(events []*NFTData)
type RestakeLog ¶
type RestakeLog struct {
UserWallet common.Address
FromOdysseyID umid.UMID
ToOdysseyID umid.UMID
Amount *big.Int
TokenType uint8
TotalStakedToFrom *big.Int
TotalStakedToTo *big.Int
Contract common.Address
}
*
* * @param user User address * @param odyssey_from Odyssey ID that the user is removing stake * @param odyssey_to Odyssey ID that the user is staking into * @param amount Amount that's being restaked * @param token Token used (MOM or DAD) * @param total_staked_from Total amount of tokens that remains staked on the `odyssey_from` * @param total_staked_to Total amount of tokens staked on `odyssey_to`
event Restake(address user, bytes16 odyssey_from, bytes16 odyssey_to, uint256 amount, Token token, uint256 total_staked_from, uint256 total_staked_to);
type StakeEvent ¶
type StakeListener ¶
type StakeListener func(events []*StakeData)
type StakeLog ¶
type StakeLog struct {
TxHash string
UserWallet common.Address
OdysseyID umid.UMID
AmountStaked *big.Int
TokenType uint8
TotalStaked *big.Int
Contract common.Address
}
*
* * @param user User address * @param odyssey Odyssey ID that's being staked * @param amount_staked Amount being staked * @param token Token used (MOM or DAD) * @param total_staked Total being staked by the user on the Odyssey
event Stake(address user, bytes16 odyssey, uint256 amount_staked, Token token, uint256 total_staked);
type TokenListener ¶
type TokenListener func(events []*TokenData)
type TransferERC20Log ¶
type TransferNFTLog ¶
type TransferNFTLog struct {
From common.Address
To common.Address
TokenID umid.UMID
Contract common.Address
}
*
- @dev Emitted when `tokenId` token is transferred from `from` to `to`.
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
type UnstakeLog ¶
type UnstakeLog struct {
UserWallet common.Address
OdysseyID umid.UMID
AmountUnstaked *big.Int
TokenType uint8
TotalStaked *big.Int
Contract common.Address
}
*
* * @param user User address * @param odyssey Odyssey ID that's being unstaked * @param amount_unstaked Amount unstaked * @param token Token used (MOM or DAD) * @param total_staked Total remained staked by the user on that Odyssey
event Unstake(address user, bytes16 odyssey, uint256 amount_unstaked, Token token, uint256 total_staked);
Click to show internal directories.
Click to hide internal directories.