near

package
v1.2.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MethodOfUpdateBlockHeader  = "update_block_header"
	MethodOfTransferIn         = "transfer_in"
	MethodOfSwapIn             = "swap_in"
	MethodOfVerifyReceiptProof = "verify_receipt_proof"
)

Variables

View Source
var (
	RetryInterval = time.Second * 5
	RetryLimit    = 5
)
View Source
var (
	OrderIdIsUsed         = "the event with order id"
	OrderIdIsUsedFlag2    = "is used"
	VerifyRangeMatch      = "cannot get epoch record for block"
	VerifyRangeMatchFlag2 = "expected range"
)
View Source
var NearEpochSize = big.NewInt(43200)

Functions

func NewWriter

func NewWriter(conn Connection, cfg *Config, log log15.Logger, stop <-chan int, sysErr chan<- error) *writer

NewWriter creates and returns writer

Types

type ActionError

type ActionError struct {
	Index int  `json:"index"`
	Kind  Kind `json:"kind"`
}

type Chain

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

func InitializeChain

func InitializeChain(chainCfg *core.ChainConfig, logger log15.Logger, sysErr chan<- error,
	role mapprotocol.Role) (*Chain, error)

func (*Chain) Conn

func (c *Chain) Conn() core.Connection

Conn return Connection interface for relayer register

func (*Chain) EthClient

func (c *Chain) EthClient() *nearclient.Client

EthClient return EthClient for global map connection

func (*Chain) Id

func (c *Chain) Id() msg.ChainId

func (*Chain) Name

func (c *Chain) Name() string

func (*Chain) SetRouter

func (c *Chain) SetRouter(r *core.Router)

func (*Chain) Start

func (c *Chain) Start() error

func (*Chain) Stop

func (c *Chain) Stop()

Stop signals to any running routines to exit

type CommonListen

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

func NewCommonListen

func NewCommonListen(conn Connection, cfg *Config, log log15.Logger, stop <-chan int, sysErr chan<- error,
	bs blockstore.Blockstorer) *CommonListen

NewCommonListen creates and returns a listener

func (*CommonListen) GetLatestBlock

func (c *CommonListen) GetLatestBlock() metrics.LatestBlock

func (*CommonListen) SetRouter

func (c *CommonListen) SetRouter(r chains.Router)

type Config

type Config struct {
	chain.Config
	// contains filtered or unexported fields
}

type Connection

type Connection interface {
	Connect() error
	Keypair() *key.KeyPair
	Opts() *bind.TransactOpts
	CallOpts() *bind.CallOpts
	LockAndUpdateOpts(bool) error
	UnlockOpts()
	Client() *nearclient.Client
	EnsureHasBytecode(address string) error
	LatestBlock() (*big.Int, error)
	WaitForBlock(block *big.Int, delay *big.Int) error
	Close()
}

type Error

type Error struct {
	ActionError ActionError `json:"ActionError"`
}

type FunctionCallError

type FunctionCallError struct {
	ExecutionError string `json:"ExecutionError"`
}

type Kind

type Kind struct {
	FunctionCallError FunctionCallError `json:"FunctionCallError"`
}

type Maintainer

type Maintainer struct {
	*CommonListen
	// contains filtered or unexported fields
}

func NewMaintainer

func NewMaintainer(cs *CommonListen) *Maintainer

func (*Maintainer) Sync

func (m *Maintainer) Sync() error

type Messenger

type Messenger struct {
	*CommonListen
}

func NewMessenger

func NewMessenger(cs *CommonListen) *Messenger

func (*Messenger) Idx added in v1.2.0

func (m *Messenger) Idx(contract string) int

func (*Messenger) Sync

func (m *Messenger) Sync() error

Jump to

Keyboard shortcuts

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