bsc

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlockInterval           = 2 * time.Second
	BlockHeightPollInterval = 60 * time.Second
)
View Source
const BLACKLIST_MESSAGE = 3
View Source
const CHANGE_TOKEN_LIMIT = 4

Variables

This section is empty.

Functions

func GetWalletFromPrivKey

func GetWalletFromPrivKey(privKey string) (wal *wallet.EvmWallet, pKey *ecdsa.PrivateKey, err error)

func NewApi

func NewApi(l log.Logger, cfg *chain.Config) (chain.ChainAPI, error)

func NewFinder

func NewFinder(l log.Logger, nameToAddrMap map[chain.ContractName]string) *finder

func NewParser

func NewParser(url string, nameToAddr map[chain.ContractName]string) (*parser, error)

Types

type BMCMessage

type BMCMessage struct {
	Src     string //  an address of BMC (i.e. btp://1234.PARA/0x1234)
	Dst     string //  an address of destination BMC
	Svc     string //  service name of BSH
	Sn      []byte //  sequence number of BMC
	Message []byte //  serialized Service Message from BSH
}

type BlockNotification

type BlockNotification struct {
	Hash   common.Hash
	Height *big.Int
	Header *types.Header
	Logs   []types.Log
}

type BnOptions

type BnOptions struct {
	StartHeight     uint64
	Concurrency     uint64
	VerifierOptions *VerifierOptions
}

type Client

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

grouped rpc api clients

func NewClients

func NewClients(urls []string, l log.Logger) (cls []*Client, err error)

type ReceiverCore

type ReceiverCore struct {
	Log      log.Logger
	Opts     ReceiverOptions
	Cls      []*ethclient.Client
	BlockReq ethereum.FilterQuery
}

func (*ReceiverCore) ReceiveLoop

func (r *ReceiverCore) ReceiveLoop(ctx context.Context, opts *BnOptions, callback func(v *BlockNotification) error) error

type ReceiverOptions

type ReceiverOptions struct {
	Verifier        *VerifierOptions `json:"verifier"`
	SyncConcurrency uint64           `json:"syncConcurrency"`
}

type ServiceMessage

type ServiceMessage struct {
	ServiceType []byte
	Payload     []byte
}

type ServiceMessagePayload

type ServiceMessagePayload struct {
	Code []byte
	Msg  []byte
}

type VerifierOptions

type VerifierOptions struct {
}

Directories

Path Synopsis
abi

Jump to

Keyboard shortcuts

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