Documentation
¶
Index ¶
- Constants
- func GetDefaultTopic(chainID int, contractAddresses ethereum.ContractAddresses) (string, error)
- type Filter
- func (f *Filter) MarshalJSON() ([]byte, error)
- func (f *Filter) MatchOrder(order *zeroex.SignedOrder) (bool, error)
- func (f *Filter) MatchOrderMessageJSON(messageJSON []byte) (bool, error)
- func (f *Filter) Rendezvous() string
- func (f *Filter) Topic() string
- func (f *Filter) UnmarshalJSON(data []byte) error
- func (f *Filter) ValidateOrder(order *zeroex.SignedOrder) (*jsonschema.Result, error)
- func (f *Filter) ValidateOrderJSON(orderJSON []byte) (*jsonschema.Result, error)
- func (f *Filter) ValidatePubSubMessage(ctx context.Context, sender peer.ID, msg *pubsub.Message) bool
- type WrongTopicVersionError
Constants ¶
View Source
const ( // DefaultCustomOrderSchema is the default schema for /customOrder. It // includes all 0x orders and doesn't add any additional requirements. DefaultCustomOrderSchema = `{}` )
Variables ¶
This section is empty.
Functions ¶
func GetDefaultTopic ¶
func GetDefaultTopic(chainID int, contractAddresses ethereum.ContractAddresses) (string, error)
Types ¶
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 (*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 (*Filter) Rendezvous ¶
func (*Filter) UnmarshalJSON ¶
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)
type WrongTopicVersionError ¶
type WrongTopicVersionError struct {
// contains filtered or unexported fields
}
func (WrongTopicVersionError) Error ¶
func (e WrongTopicVersionError) Error() string
Click to show internal directories.
Click to hide internal directories.