ton

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2025 License: LGPL-3.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64ToHex

func Base64ToHex(base64Str string) (string, error)

func CalculateCellCount

func CalculateCellCount(data []byte) int

func DecodePayload

func DecodePayload(rootCell *cell.Cell) ([]byte, error)

func EncodeMessage

func EncodeMessage(data []byte) (*cell.Cell, error)

func EncodePayload

func EncodePayload(data []byte) (*cell.Cell, error)

func GenerateMessageInCell

func GenerateMessageInCell(
	hash common.Hash,
	expectedAddress common.Address,
	signs []*Signature,
	receiptRoot common.Hash,
	version common.Hash,
	blockNum int64,
	chainId int64,
	addr common.Address,
	topics []common.Hash,
	message []byte,
) (*cell.Cell, error)

Types

type Chain

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

func New

func New() *Chain

func (*Chain) Conn

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

Conn return Connection interface for relayer register

func (*Chain) Id

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

func (*Chain) Name

func (c *Chain) Name() string

func (*Chain) New

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

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 Config

type Config struct {
	chain.Config
	Words       string
	McsContract []string
	Event       []string
}

type Connection

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

func NewConnection

func NewConnection(endpoint, words, password string, kp *keystore.Key, log log15.Logger) *Connection

func (*Connection) CallOpts

func (c *Connection) CallOpts() *bind.CallOpts

func (*Connection) Client

func (c *Connection) Client() *ethclient.Client

func (*Connection) Close

func (c *Connection) Close()

func (*Connection) Connect

func (c *Connection) Connect() error

func (*Connection) EnsureHasBytecode

func (c *Connection) EnsureHasBytecode(addr ethcommon.Address) error

EnsureHasBytecode asserts if contract code exists at the specified address

func (*Connection) Keypair

func (c *Connection) Keypair() *keystore.Key

func (*Connection) LatestBlock

func (c *Connection) LatestBlock() (*big.Int, error)

LatestBlock returns the latest block from the current chain

func (*Connection) LockAndUpdateOpts

func (c *Connection) LockAndUpdateOpts(needNewNonce bool) error

func (*Connection) Opts

func (c *Connection) Opts() *bind.TransactOpts

func (*Connection) UnlockOpts

func (c *Connection) UnlockOpts()

func (*Connection) WaitForBlock

func (c *Connection) WaitForBlock(targetBlock *big.Int, delay *big.Int) error

type Handler

type Handler func(*sync) (int64, error)

type Log

type Log struct {
	Id          int64  `json:"id"`
	BlockNumber int64  `json:"blockNumber"`
	Addr        string `json:"addr"`
	Topic       string `json:"topic"`
	Data        string `json:"data"`
	TxHash      string `json:"txHash"`
}

type MessageOutEvent

type MessageOutEvent struct {
	Relay       bool
	MessageType uint8
	FromChain   *big.Int
	ToChain     *big.Int
	OrderId     [32]byte
	Mos         []byte
	Token       []byte
	Initiator   []byte
	From        []byte
	To          []byte
	Amount      *big.Int
	GasLimit    *big.Int
	SwapData    []byte
}

type Signature

type Signature struct {
	V uint64
	R *big.Int
	S *big.Int
}

type Writer

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

func (*Writer) ResolveMessage

func (w *Writer) ResolveMessage(m msg.Message) bool

Jump to

Keyboard shortcuts

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