Documentation ¶
Index ¶
- func HexToAddress(s string) []byte
- type Adapter
- type AdapterListener
- type Address
- type BCBlock
- type BCDiff
- type BCStake
- type BCType
- type Event
- type NftEvent
- type RestakeLog
- type StakeEvent
- type StakeLog
- type Table
- type TransferERC20Log
- type TransferNFTLog
- type TransferOdysseyEvent
- type TransferOdysseyLog
- type UnstakeLog
- type UpdateEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HexToAddress ¶
Types ¶
type Adapter ¶
type Adapter interface { GetLastBlockNumber() (uint64, error) GetBalance(wallet string, contract string, blockNumber uint64) (*big.Int, error) GetLogs(fromBlock, toBlock int64, addresses []common.Address) ([]any, error) GetLogsRecursively(fromBlock, toBlock int64, addresses []common.Address, level int) ([]any, error) RegisterNewBlockListener(f AdapterListener) Run() GetInfo() (umid umid.UMID, name string, rpcURL string) }
type AdapterListener ¶
type RestakeLog ¶
type RestakeLog struct { UserWallet string FromOdysseyID umid.UMID ToOdysseyID umid.UMID Amount *big.Int TokenType uint8 TotalStakedToFrom *big.Int TotalStakedToTo *big.Int }
*
* * @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 StakeLog ¶
type StakeLog struct { LogIndex uint TxHash string UserWallet string OdysseyID umid.UMID AmountStaked *big.Int TokenType uint8 TotalStaked *big.Int }
*
* * @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 Table ¶
type Table struct {
// contains filtered or unexported fields
}
func NewTable ¶
func NewTable(db *pgxpool.Pool, adapter Adapter, listener func(bcName string, p []*UpdateEvent, s []*StakeEvent, n []*NftEvent, t []*TransferOdysseyEvent) error) *Table
func (*Table) GetLastCommentByTxHash ¶
func (*Table) ProcessLogs ¶
func (*Table) SaveToDB ¶
func (t *Table) SaveToDB(events []*UpdateEvent, stakeEvents []*StakeEvent, nftLogs []*TransferNFTLog) (err error)
type TransferERC20Log ¶
type TransferNFTLog ¶
*
- @dev Emitted when `tokenId` token is transferred from `from` to `to`.
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
type TransferOdysseyEvent ¶
type TransferOdysseyLog ¶
type UnstakeLog ¶
type UnstakeLog struct { LogIndex uint TxHash string UserWallet string OdysseyID umid.UMID AmountUnstaked *big.Int TokenType uint8 TotalStaked *big.Int }
*
* * @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.