services

package
v0.0.0-...-bee63d0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAddressesToWatch

func GetAddressesToWatch() []common.Address

func GetBalance

func GetBalance(client *ethclient.Client, address string, blockNumber string) float64

func GetTransaction

func GetTransaction(client *rpc.Client, log types.Log) *models.Transaction

func HandleNewLog

func HandleNewLog(client *rpc.Client, log types.Log) error

func ListenToERC1155Events

func ListenToERC1155Events(app models.App) error

func SaveTransaction

func SaveTransaction(tx models.Transaction) (bool, error)

func Subscribe

func Subscribe(app models.App, client *ethclient.Client, logsCh chan types.Log) error

Types

type Block

type Block struct {
	Hash         string `json:"hash"`
	Number       string `json:"number"`
	Timestamp    string `json:"timestamp"`
	Transactions []Transaction
}

func GetBlock

func GetBlock(client *rpc.Client, blockHash string) *Block

type Transaction

type Transaction struct {
	From     string `json:"from"`
	Gas      string `json:"gas"`
	GasPrice string `json:"gasPrice"`
	Hash     string `json:"hash"`
	To       string `json:"to"`
	Type     string `json:"type"`
	Value    string `json:"value"`
}

Jump to

Keyboard shortcuts

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