subscriber

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: LGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockByHashOutput added in v0.0.7

type BlockByHashOutput struct {
	Jsonrpc string          `json:"jsonrpc"`
	Id      int             `json:"id"`
	Result  *ethtypes.Block `json:"result"`
}

type BlockByNumberOutput added in v0.0.7

type BlockByNumberOutput struct {
	Jsonrpc string           `json:"jsonrpc"`
	Id      string           `json:"id"`
	Result  *ethtypes.Header `json:"result"`
	Error   *struct {
		Code    int    `json:"code"`
		Message string `json:"message"`
	} `json:"error"`
}

type BlockNumberOutput added in v0.0.7

type BlockNumberOutput struct {
	Jsonrpc string `json:"jsonrpc"`
	Id      int    `json:"id"`
	Result  string `json:"result"`
}

type EthRpcInput added in v0.0.7

type EthRpcInput struct {
	JsonRpc string        `json:"jsonrpc"`
	Method  string        `json:"method"`
	Params  []interface{} `json:"params"`
	Id      string        `json:"id"`
}

type EthereumSubscriber

type EthereumSubscriber struct {
	// contains filtered or unexported fields
}

func NewEthereumSubscriber

func NewEthereumSubscriber(chainId string, rpcUrl string, logger log.Logger, repo repository.Repository) (*EthereumSubscriber, error)

func (*EthereumSubscriber) GetOldestBlock added in v0.0.6

func (sub *EthereumSubscriber) GetOldestBlock(timestamp uint64) (oracletypes.BlockData, error)

GetOldestBlock returns the latest block data

func (*EthereumSubscriber) Id

func (sub *EthereumSubscriber) Id() string

func (*EthereumSubscriber) OwnerOf

func (sub *EthereumSubscriber) OwnerOf(_ context.Context, nftAddressHex string, tokenIdHex string, blockHash string) (string, error)

OwnerOf returns the owner of the given NFT

func (*EthereumSubscriber) Start

func (sub *EthereumSubscriber) Start(ctx context.Context)

func (*EthereumSubscriber) Stop

func (sub *EthereumSubscriber) Stop()

type FilterLogOutput added in v0.0.7

type FilterLogOutput struct {
	Jsonrpc string         `json:"jsonrpc"`
	Id      string         `json:"id"`
	Result  []ethtypes.Log `json:"result"`
}

type OwnerOfOutput added in v0.0.7

type OwnerOfOutput struct {
	JsonRpc string `json:"jsonrpc"`
	Id      int    `json:"id"`
	Result  string `json:"result"`
}

type Subscriber

type Subscriber interface {
	Id() string
	Start(ctx context.Context)
	Stop()
	GetOldestBlock(timestamp uint64) (oracletypes.BlockData, error)
	OwnerOf(ctx context.Context, nftAddressHex string, tokenIdHex string, blockHash string) (string, error)
}

func InitSubscribers

func InitSubscribers(config *config.Config, logger log.Logger) (subscribers []Subscriber, err error)

func NewSubscriber

func NewSubscriber(config config.ChainConfig, logger log.Logger, repo repository.Repository) (Subscriber, error)

Jump to

Keyboard shortcuts

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