Back to godoc.org

Package orderfilter

v0.0.0-...-0677443
Latest Go to latest

The highest tagged major version is .

Published: Aug 20, 2020 | License: Apache-2.0 | Module: github.com/0xProject/0x-mesh

Index

Constants

const (

	// DefaultCustomOrderSchema is the default schema for /customOrder. It
	// includes all 0x orders and doesn't add any additional requirements.
	DefaultCustomOrderSchema = `{}`
)

func GetDefaultTopic

func GetDefaultTopic(chainID int, contractAddresses ethereum.ContractAddresses) (string, error)

type Filter

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

func GetDefaultFilter

func GetDefaultFilter(chainID int, contractAddresses ethereum.ContractAddresses) (*Filter, error)

func New

func New(chainID int, customOrderSchema string, contractAddresses ethereum.ContractAddresses) (*Filter, error)

TODO(jalextowle): We do not need `contractAddresses` since we only use `contractAddresses.Exchange`. In a future refactor, we should update this interface.

func NewFromTopic

func NewFromTopic(topic string, contractAddresses ethereum.ContractAddresses) (*Filter, error)

func (*Filter) MarshalJSON

func (f *Filter) MarshalJSON() ([]byte, error)

func (*Filter) MatchOrder

func (f *Filter) MatchOrder(order *zeroex.SignedOrder) (bool, error)

MatchOrder returns true if the order passes the filter. It only returns an error if there was a problem with validation. For details about orders that do not pass the filter, use ValidateOrder.

func (*Filter) MatchOrderMessageJSON

func (f *Filter) MatchOrderMessageJSON(messageJSON []byte) (bool, error)

func (*Filter) Rendezvous

func (f *Filter) Rendezvous() string

func (*Filter) Topic

func (f *Filter) Topic() string

func (*Filter) UnmarshalJSON

func (f *Filter) UnmarshalJSON(data []byte) error

func (*Filter) ValidateOrder

func (f *Filter) ValidateOrder(order *zeroex.SignedOrder) (*jsonschema.Result, error)

func (*Filter) ValidateOrderJSON

func (f *Filter) ValidateOrderJSON(orderJSON []byte) (*jsonschema.Result, error)

func (*Filter) ValidatePubSubMessage

func (f *Filter) ValidatePubSubMessage(ctx context.Context, sender peer.ID, msg *pubsub.Message) bool

ValidatePubSubMessage is an implementation of pubsub.Validator and will return true if the contents of the message pass the message JSON Schema.

type WrongTopicVersionError

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

func (WrongTopicVersionError) Error

func (e WrongTopicVersionError) Error() string

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier