0x-mesh: github.com/0xProject/0x-mesh/orderfilter Index | Files

package orderfilter

import "github.com/0xProject/0x-mesh/orderfilter"

Index

Package Files

filter.go schemas.go shared.go validate.go

Constants

const (

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

func GetDefaultTopic Uses

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

type Filter Uses

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

func GetDefaultFilter Uses

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

func New Uses

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 Uses

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

func (*Filter) MarshalJSON Uses

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

func (*Filter) MatchOrder Uses

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 Uses

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

func (*Filter) Rendezvous Uses

func (f *Filter) Rendezvous() string

func (*Filter) Topic Uses

func (f *Filter) Topic() string

func (*Filter) UnmarshalJSON Uses

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

func (*Filter) ValidateOrder Uses

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

func (*Filter) ValidateOrderJSON Uses

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

func (*Filter) ValidatePubSubMessage Uses

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 Uses

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

func (WrongTopicVersionError) Error Uses

func (e WrongTopicVersionError) Error() string

Package orderfilter imports 13 packages (graph) and is imported by 1 packages. Updated 2020-09-21. Refresh now. Tools for package owners.