Documentation
¶
Index ¶
- type Chain
- func (c *Chain) Conn() core.Connection
- func (c *Chain) Id() msg.ChainId
- func (c *Chain) Name() string
- func (c *Chain) New(chainCfg *core.ChainConfig, logger log15.Logger, sysErr chan<- error, ...) (core.Chain, error)
- func (c *Chain) SetRouter(r core.Router)
- func (c *Chain) Start() error
- func (c *Chain) Stop()
- type Config
- type Connection
- func (c *Connection) CallOpts() *bind.CallOpts
- func (c *Connection) Client() *ethclient.Client
- func (c *Connection) Close()
- func (c *Connection) Connect() error
- func (c *Connection) EnsureHasBytecode(addr ethcommon.Address) error
- func (c *Connection) Keypair() *keystore.Key
- func (c *Connection) LatestBlock() (*big.Int, error)
- func (c *Connection) LockAndUpdateOpts(needNewNonce bool) error
- func (c *Connection) Opts() *bind.TransactOpts
- func (c *Connection) UnlockOpts()
- func (c *Connection) WaitForBlock(targetBlock *big.Int, delay *big.Int) error
- type GenerateRequest
- type Handler
- type Log
- type LogData
- type MessageData
- type Pubkey
- type Resp
- type RouteOrder
- type SwapData
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
func (*Chain) Conn ¶
func (c *Chain) Conn() core.Connection
Conn return Connection interface for relayer register
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection(endpoint string, 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
Connect starts the ethereum WS connection
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 ¶
type GenerateRequest ¶
type LogData ¶
type LogData struct {
OrderId string `json:"orderId"`
Relay int `json:"relay"`
MessageType int `json:"messageType"`
FromChain string `json:"fromChain"`
ToChain string `json:"toChain"`
Mos string `json:"mos"`
Token string `json:"token"`
Initiator string `json:"initiator"`
From string `json:"from"`
To string `json:"to"`
Amount string `json:"amount"`
GasLimit string `json:"gasLimit"`
SwapData string `json:"swapData"`
}
type MessageData ¶
type MessageData struct {
Version *big.Int
MessageType *big.Int
TokenLen *big.Int
MosLen *big.Int
FromLen *big.Int
ToLen *big.Int
PayloadLen *big.Int
TokenAmount *big.Int
TokenAddress []byte
Mos []byte
From []byte
To []byte
Payload []byte
}
func DecodeRelayData ¶
func DecodeRelayData(data string) (*MessageData, error)
type RouteOrder ¶
type RouteOrder struct {
OrderID [32]byte
Payer Pubkey
User Pubkey
FromChainID uint64
ToChainID uint64
FromToken Pubkey
TokenAmount uint128 // uint128 is implemented as a custom struct
AmountOut uint64
SwapData []byte
}
func DecodeRouteOrder ¶
func DecodeRouteOrder(data []byte) (*RouteOrder, error)
func (*RouteOrder) Encode ¶
func (ro *RouteOrder) Encode() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.