solvernet

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 AllEventTopics

func AllEventTopics() []common.Hash

AllEventTopics returns all solvernet event topics.

func DetectCustomError

func DetectCustomError(custom error) string

func PackFillCalldata

func PackFillCalldata(orderID OrderID, fillOriginData []byte) ([]byte, error)

func PackFillOriginData

func PackFillOriginData(data bindings.SolverNetFillOriginData) ([]byte, error)

func PackOrderData

func PackOrderData(data bindings.SolverNetOrderData) ([]byte, error)

func ParseFillOriginData

func ParseFillOriginData(data []byte) (bindings.SolverNetFillOriginData, error)

func ParseOrderData

func ParseOrderData(data []byte) (bindings.SolverNetOrderData, error)

func WithFillDeadline

func WithFillDeadline(t time.Time) func(*OpenOpts)

Types

type Call

type Call struct {
	Target common.Address
	Value  *big.Int
	Data   []byte
}

Call is a bindings.SolverNetCall with Selector and Params joined into Data.

type Calls

type Calls []Call

func (Calls) ToBindings

func (cs Calls) ToBindings() []bindings.SolverNetCall

type Deposit

type Deposit = bindings.SolverNetDeposit

type EventMeta

type EventMeta struct {
	Topic   common.Hash
	Status  OrderStatus
	ParseID func(contract bindings.SolverNetInboxFilterer, log types.Log) (OrderID, error)
}

EventMeta contains metadata about an event.

func EventByTopic

func EventByTopic(topic common.Hash) (EventMeta, bool)

EventByTopic returns the event metadata for a given topic.

type Expenses

type Expenses []Expense

func (Expenses) NoNative

func (es Expenses) NoNative() Expenses

type FillOriginData

type FillOriginData = bindings.SolverNetFillOriginData

type OpenOpts

type OpenOpts struct {
	FillDeadline time.Time
}

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.

func ParseClaimed

func ParseClaimed(contract bindings.SolverNetInboxFilterer, log types.Log) (OrderID, error)

func ParseClosed

func ParseClosed(contract bindings.SolverNetInboxFilterer, log types.Log) (OrderID, error)

func ParseFilled

func ParseFilled(contract bindings.SolverNetInboxFilterer, log types.Log) (OrderID, error)

func ParseOpened

func ParseOpened(contract bindings.SolverNetInboxFilterer, log types.Log) (OrderID, error)

func ParseRejected

func ParseRejected(contract bindings.SolverNetInboxFilterer, log types.Log) (OrderID, error)

func (OrderID) String

func (id OrderID) String() string

String returns the Uint64 representation of the order ID as a string.

func (OrderID) Uint64

func (id OrderID) Uint64() uint64

Uint64 returns the order ID as a BigEndian uint64 (monotonically incrementing number).

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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