bridge

package
v0.0.0-...-72888ac Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SlotERC20 = 1
	SlotNFT   = 2
)

Variables

View Source
var (
	ErrEventNotFound = errors.New("event not found")
	ErrPairNotFound  = errors.New("pair not found")
)

Functions

This section is empty.

Types

type Bridge

type Bridge struct {
	sync.Mutex

	DB store.Store

	CustomConfirmedHandler confirm.HashHandler
	CustomErrHandler       confirm.ErrHandler

	EventMapERC20       map[string]*pb.EventERC20Deposited
	EventMapNFT         map[string]*pb.EventNFTDeposited
	ConfirmedBlockERC20 pb.ConfirmedBlock
	ConfirmedBlockNFT   pb.ConfirmedBlock
	// contains filtered or unexported fields
}

func NewBridge

func NewBridge(ctx context.Context, c *client.Client, rc *client.ReadClient, confirmer *confirm.Confirmer, privKey string, path string, opts ...Option) (b *Bridge, err error)

func (*Bridge) Close

func (b *Bridge) Close(cancel context.CancelFunc, retryLimit int, commitStarts bool)

func (*Bridge) FetchERC20

func (b *Bridge) FetchERC20(ctx context.Context) (uint64, error)

func (*Bridge) FetchNFT

func (b *Bridge) FetchNFT(ctx context.Context) (uint64, error)

func (*Bridge) Start

func (b *Bridge) Start(ctx context.Context) (err error)

type CustomConfirmedHandler

type CustomConfirmedHandler confirm.HashHandler

func WithCustomConfirmedHandler

func WithCustomConfirmedHandler(f confirm.HashHandler) CustomConfirmedHandler

func (CustomConfirmedHandler) Apply

func (f CustomConfirmedHandler) Apply(b *Bridge) error

type CustomErrHandler

type CustomErrHandler confirm.ErrHandler

func WithCustomErrHandler

func WithCustomErrHandler(f confirm.ErrHandler) CustomErrHandler

func (CustomErrHandler) Apply

func (f CustomErrHandler) Apply(b *Bridge) error

type Option

type Option interface {
	Apply(*Bridge) error
}

type Rotator

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

func NewRotator

func NewRotator(size int) Rotator

func (*Rotator) Rotate

func (r *Rotator) Rotate() int

type Wallet

type Wallet struct {
	Nonce *nonce.Nonce
	// contains filtered or unexported fields
}

func NewWallet

func NewWallet(ctx context.Context, client nonce.Client, privKey string) (w Wallet, err error)

func (Wallet) IncrementNonce

func (w Wallet) IncrementNonce() (uint64, error)

Jump to

Keyboard shortcuts

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