Documentation ¶
Index ¶
- Variables
- type ChainProviderError
- type Client
- func (c *Client) ClaimFee(chain string) (*ResClaimFee, error)
- func (c *Client) Close() error
- func (c *Client) GetBlock(chain string) ([]*ResGetBlock, error)
- func (c *Client) GetFee(chain string, network string, isReponse bool) (*ResGetFee, error)
- func (c *Client) GetLatestHeight(chain string) (*ResChainHeight, error)
- func (c *Client) GetMessageList(chain string, limit uint) (*ResMessageList, error)
- func (c *Client) MessageRemove(chain string, sn *big.Int) (*ResMessageRemove, error)
- func (c *Client) PruneDB() (*ResPruneDB, error)
- func (c *Client) QueryBlockRange(chain string, fromHeight, toHeight uint64) (*ResRangeBlockQuery, error)
- func (c *Client) RelayMessage(chain string, height uint64, txHash string) ([]*types.Message, error)
- func (c *Client) RevertMessage(chain string, sn uint64) (*ResRevertMessage, error)
- func (c *Client) SetFee(chain, network string, msgFee, resFee *big.Int) (*ResSetFee, error)
- type ErrResponse
- type Event
- type Pagination
- type ReqChainHeight
- type ReqClaimFee
- type ReqGetBalance
- type ReqGetBlock
- type ReqGetBlockEvents
- type ReqGetFee
- type ReqListChain
- type ReqMessageList
- type ReqMessageReceived
- type ReqMessageRemove
- type ReqProcessedBlock
- type ReqPruneDB
- type ReqRangeBlockQuery
- type ReqRelayInfo
- type ReqRelayMessage
- type ReqRevertMessage
- type ReqSetFee
- type Request
- type ResChainHeight
- type ResChainInfo
- type ResClaimFee
- type ResGetBalance
- type ResGetBlock
- type ResGetBlockEvents
- type ResGetFee
- type ResMessageList
- type ResMessageReceived
- type ResMessageRemove
- type ResPruneDB
- type ResRangeBlockQuery
- type ResRelayInfo
- type ResRevertMessage
- type ResSetFee
- type Response
- type Server
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnknownEvent = fmt.Errorf("unknown event") ErrSocketClosed = fmt.Errorf("socket closed") ErrInvalidResponse = func(err error) error { return fmt.Errorf("invalid response: %v", err) } ErrUnknown = fmt.Errorf("unknown error") )
View Source
var (
SocketPath = getEnvOrFallback("SOCKET_PATH", path.Join(os.TempDir(), "relayer.sock"))
)
Functions ¶
This section is empty.
Types ¶
type ChainProviderError ¶ added in v1.6.0
type ChainProviderError struct {
Message string
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ClaimFee ¶ added in v1.1.0
func (c *Client) ClaimFee(chain string) (*ResClaimFee, error)
ClaimFee sends ClaimFee event to socket
func (*Client) GetBlock ¶
func (c *Client) GetBlock(chain string) ([]*ResGetBlock, error)
GetBlock sends GetBlock event to socket
func (*Client) GetLatestHeight ¶ added in v1.9.0
func (c *Client) GetLatestHeight(chain string) (*ResChainHeight, error)
func (*Client) GetMessageList ¶
func (c *Client) GetMessageList(chain string, limit uint) (*ResMessageList, error)
GetMessageList sends GetMessageList event to socket
func (*Client) MessageRemove ¶
MessageRemove sends MessageRemove event to socket
func (*Client) PruneDB ¶
func (c *Client) PruneDB() (*ResPruneDB, error)
PruneDB sends PruneDB event to socket
func (*Client) QueryBlockRange ¶ added in v1.9.0
func (c *Client) QueryBlockRange(chain string, fromHeight, toHeight uint64) (*ResRangeBlockQuery, error)
func (*Client) RelayMessage ¶
RelayMessage sends RelayMessage event to socket
func (*Client) RevertMessage ¶
func (c *Client) RevertMessage(chain string, sn uint64) (*ResRevertMessage, error)
RevertMessage sends RevertMessage event to socket
type ErrResponse ¶
type ErrResponse struct {
Error string `json:"error"`
}
type Event ¶
type Event string
const ( EventGetBlock Event = "GetBlock" EventGetMessageList Event = "GetMessageList" EventRelayMessage Event = "RelayMessage" EventRelayRangeMessage Event = "RelayRangeMessage" EventMessageRemove Event = "MessageRemove" EventPruneDB Event = "PruneDB" EventRevertMessage Event = "RevertMessage" EventError Event = "Error" EventGetFee Event = "GetFee" EventSetFee Event = "SetFee" EventClaimFee Event = "ClaimFee" EventGetLatestHeight Event = "GetLatestHeight" EventGetBlockRange Event = "GetBlockRange" EventGetConfig Event = "GetConfig" EventListChainInfo Event = "ListChainInfo" EventGetBalance Event = "GetChainBalance" EventRelayerInfo Event = "RelayerInfo" EventMessageReceived Event = "MessageReceived" EventGetBlockEvents Event = "GetBlockEvents" )
type Pagination ¶ added in v1.9.0
type ReqChainHeight ¶ added in v1.9.0
type ReqChainHeight struct {
Chain string `json:"chain"`
}
type ReqClaimFee ¶ added in v1.1.0
type ReqClaimFee struct {
Chain string `json:"chain"`
}
ReqClaimFee sends ClaimFee event to socket
type ReqGetBalance ¶ added in v1.9.0
type ReqGetBlock ¶
type ReqGetBlock struct {
Chain string `json:"chain"`
}
type ReqGetBlockEvents ¶ added in v1.9.0
type ReqListChain ¶ added in v1.9.0
type ReqListChain struct {
Chains []string `json:"chains,omitempty"`
}
type ReqMessageList ¶
type ReqMessageReceived ¶ added in v1.9.0
type ReqMessageRemove ¶
type ReqProcessedBlock ¶ added in v1.9.0
type ReqProcessedBlock struct {
Chain string `json:"chain"`
}
type ReqPruneDB ¶
type ReqRangeBlockQuery ¶ added in v1.9.0
type ReqRelayInfo ¶ added in v1.9.0
type ReqRelayInfo struct{}
type ReqRelayMessage ¶
type ReqRevertMessage ¶
type ReqSetFee ¶ added in v1.1.0
type ReqSetFee struct { Chain string `json:"chain"` Network string `json:"network"` MsgFee *big.Int `json:"msg_fee"` ResFee *big.Int `json:"res_fee"` }
ReqSetFee sends SetFee event to socket
type ResChainHeight ¶ added in v1.9.0
type ResChainInfo ¶ added in v1.9.0
type ResClaimFee ¶ added in v1.1.0
type ResClaimFee struct {
Status string `json:"status"`
}
ResClaimFee sends ClaimFee event to socket
type ResGetBalance ¶ added in v1.9.0
type ResGetBlock ¶
type ResGetBlockEvents ¶ added in v1.9.0
type ResGetBlockEvents struct { Event string `json:"event"` Height uint64 `json:"height"` Executed bool `json:"executed"` TxHash string `json:"txHash"` ChainInfo struct { NID string `json:"nid"` Name string `json:"name"` Type string `json:"type"` Contracts types.ContractConfigMap `json:"contracts"` } `json:"chainInfo"` }
type ResMessageList ¶
type ResMessageList struct { Message []*types.RouteMessage `json:"message"` Total int `json:"total"` }
type ResMessageReceived ¶ added in v1.9.0
type ResMessageRemove ¶
type ResPruneDB ¶
type ResPruneDB struct {
Status string `json:"status"`
}
type ResRangeBlockQuery ¶ added in v1.9.0
type ResRelayInfo ¶ added in v1.9.0
type ResRevertMessage ¶
type ResRevertMessage struct {
Sn uint64 `json:"sn"`
}
type ResSetFee ¶ added in v1.1.0
type ResSetFee struct {
Status string `json:"status"`
}
ResSetFee sends SetFee event to socket
type Response ¶ added in v1.9.0
Click to show internal directories.
Click to hide internal directories.