Documentation
¶
Index ¶
- Constants
- Variables
- func AddHLNetwork(ctx context.Context, network netconf.Network, ...) netconf.Network
- func AllEventTopics() []common.Hash
- func CallsToBindings(calls []Call) []bindings.SolverNetCall
- func DetectCustomError(custom error) string
- func FillHash(orderID OrderID, fillData bindings.SolverNetFillOriginData) (common.Hash, error)
- func FilterByBackends(backends ethbackend.Backends) func(netconf.ID, netconf.Chain) bool
- func FilterByContracts(ctx context.Context, endpoints xchain.RPCEndpoints) func(netconf.ID, netconf.Chain) bool
- func FilterByEndpoints(endpoints xchain.RPCEndpoints) func(netconf.ID, netconf.Chain) bool
- func HLChains(network netconf.ID) []netconf.Chain
- func HyperlaneMailbox(chainID uint64) (common.Address, bool)
- func IsCore(chainID uint64) bool
- func IsDisabled(_ uint64) bool
- func IsHL(chainID uint64) bool
- func IsHLOnly(chainID uint64) bool
- func IsHLRole(role eoa.Role) bool
- func IsSupported(chainID uint64) bool
- func OnlyCoreEndpoints(endpoints xchain.RPCEndpoints) xchain.RPCEndpoints
- func PackFillCalldata(orderID OrderID, fillOriginData []byte) ([]byte, error)
- func PackFillOriginData(data bindings.SolverNetFillOriginData) ([]byte, error)
- func PackOrderData(data bindings.SolverNetOrderData) ([]byte, error)
- func ParseEvent(l types.Log) (OrderID, OrderStatus, error)
- func ParseFillOriginData(data []byte) (bindings.SolverNetFillOriginData, error)
- func ParseOrderData(data []byte) (bindings.SolverNetOrderData, error)
- func Provider(srcChainID, destChainID uint64) (uint8, bool)
- func WithFillDeadline(t time.Time) func(*OpenOpts)
- type Call
- type Deposit
- type EventMeta
- type Expense
- type FillOriginData
- type OpenOpts
- type OrderID
- func OpenOrder(ctx context.Context, network netconf.ID, chainID uint64, ...) (OrderID, error)
- func ParseClaimed(log types.Log) (OrderID, error)
- func ParseClosed(log types.Log) (OrderID, error)
- func ParseFilled(log types.Log) (OrderID, error)
- func ParseOpened(log types.Log) (OrderID, error)
- func ParseRejected(log types.Log) (OrderID, error)
- type OrderResolved
- type OrderState
- type OrderStatus
Constants ¶
const ( ProviderNone uint8 = iota // No provider ProviderCore uint8 = 1 // Omni Core ProviderHL uint8 = 2 // Hyperlane )
Variables ¶
var ( // Event log topics (common.Hash). TopicOpened = mustGetEventTopic(inboxABI, "Open") TopicRejected = mustGetEventTopic(inboxABI, "Rejected") TopicClosed = mustGetEventTopic(inboxABI, "Closed") TopicFilled = mustGetEventTopic(inboxABI, "Filled") TopicClaimed = mustGetEventTopic(inboxABI, "Claimed") )
Functions ¶
func AddHLNetwork ¶ added in v0.15.0
func AddHLNetwork(ctx context.Context, network netconf.Network, selectors ...func(netconf.ID, netconf.Chain) bool) netconf.Network
AddHLNetwork returns a copy of the network with hyperlane-secured chains added. Optional selector functions can be provided to filter the chains.
func AllEventTopics ¶
AllEventTopics returns all solvernet event topics.
func CallsToBindings ¶ added in v0.14.0
func CallsToBindings(calls []Call) []bindings.SolverNetCall
CallsToBindings is a convenience function to convert a slice of Calls to a slice of bindings.SolverNetCall.
func DetectCustomError ¶
func FilterByBackends ¶ added in v0.15.0
FilterByBackends returns an HL chain selector that excludes chains not in backends. Useful when needing to deploy contracts to configured backends.
func FilterByContracts ¶ added in v0.15.0
func FilterByContracts(ctx context.Context, endpoints xchain.RPCEndpoints) func(netconf.ID, netconf.Chain) bool
FilterByContracts returns an HL chain selector that excludes chains without inbox contracts deployed. Note this also excludes chains without endpoints, or with any other error fetching inbox DeployedAt.
func FilterByEndpoints ¶ added in v0.15.0
FilterByEndpoints returns an HL chain selector that excludes chains without endpoints.
func HLChains ¶ added in v0.15.0
HLChains returns the list of hyperlane-secured chains for a given solvernet network.
func HyperlaneMailbox ¶ added in v0.15.0
HyperlaneMailbox returns the Hyperlane mailbox address for `chainID`.
func IsDisabled ¶ added in v0.15.0
IsDisabled returns true if the chain is disabled. This configures all routes for this chain to be disabled locally and remotely.
func IsHLOnly ¶ added in v0.15.0
IsHLOnly returns true if the chain only supports Hyperlane interop.
func IsSupported ¶ added in v0.15.0
IsSupported returns true if the chain ID is supported.
func OnlyCoreEndpoints ¶ added in v0.15.0
func OnlyCoreEndpoints(endpoints xchain.RPCEndpoints) xchain.RPCEndpoints
onlyCoreEndpoints filters the given RPC endpoints to only include core endpoints. Necessary prereq for netconf.AwaitOnExecutionChain, which expects all endopints to have portal registrations.
func PackFillCalldata ¶
func PackFillOriginData ¶
func PackFillOriginData(data bindings.SolverNetFillOriginData) ([]byte, error)
func PackOrderData ¶
func PackOrderData(data bindings.SolverNetOrderData) ([]byte, error)
func ParseEvent ¶ added in v0.14.0
func ParseEvent(l types.Log) (OrderID, OrderStatus, error)
ParseEvent return the order ID and status from the event log.
func ParseFillOriginData ¶
func ParseFillOriginData(data []byte) (bindings.SolverNetFillOriginData, error)
func ParseOrderData ¶
func ParseOrderData(data []byte) (bindings.SolverNetOrderData, error)
func Provider ¶ added in v0.15.0
Provider returns the provider between a source and destination chain. It returns false if the route is not supported.
func WithFillDeadline ¶
Types ¶
type Call ¶
Call is a bindings.SolverNetCall with Selector and Params joined into Data.
func CallFromBinding ¶ added in v0.15.0
func CallFromBinding(c bindings.SolverNetCall) Call
func (Call) ToBinding ¶ added in v0.14.0
func (c Call) ToBinding() bindings.SolverNetCall
ToBinding converts a Call to a bindings.SolverNetCall. Specifically, it splits the Data field into Selector and Params.
type Deposit ¶
type Deposit = bindings.SolverNetDeposit
type EventMeta ¶
type EventMeta struct { Topic common.Hash Status OrderStatus ParseID func(log types.Log) (OrderID, error) }
EventMeta contains metadata about an event.
type Expense ¶
type Expense = bindings.SolverNetTokenExpense
func FilterNativeExpenses ¶ added in v0.14.0
FilterNativeExpenses filters out native expenses. Specifying explicit native expenses is not required (not valid), since they are automatically inferred from calls (having non-zero value).
type FillOriginData ¶
type FillOriginData = bindings.SolverNetFillOriginData
type OpenOpts ¶
func DefaultOpenOpts ¶
func DefaultOpenOpts() *OpenOpts
type OrderID ¶
type OrderID [32]byte
func OpenOrder ¶
func OpenOrder( ctx context.Context, network netconf.ID, chainID uint64, backends ethbackend.Backends, user common.Address, orderData bindings.SolverNetOrderData, opts ...func(*OpenOpts), ) (OrderID, error)
OpenOrder opens an order on chainID for user. user pays for the order, and must be in the backend for chainID. It returns the order id.
type OrderResolved ¶
type OrderResolved = bindings.IERC7683ResolvedCrossChainOrder
type OrderState ¶
type OrderState = bindings.ISolverNetInboxOrderState
type OrderStatus ¶
type OrderStatus uint8
const ( StatusInvalid OrderStatus = 0 StatusPending OrderStatus = 1 StatusRejected OrderStatus = 2 StatusClosed OrderStatus = 3 StatusFilled OrderStatus = 4 StatusClaimed OrderStatus = 5 )
func (OrderStatus) String ¶
func (s OrderStatus) String() string
func (OrderStatus) Uint8 ¶
func (s OrderStatus) Uint8() uint8
func (OrderStatus) ValidTarget ¶ added in v0.15.0
func (s OrderStatus) ValidTarget(target OrderStatus) bool
ValidTarget returns true if the target status can be reached from the current status.