gqltypes

package
v0.0.0-...-a40744b Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func AddOrderOptsToCommonType

func AddOrderOptsToCommonType(opts *AddOrdersOpts) *types.AddOrdersOpts

func FilterKindToDBType

func FilterKindToDBType(kind FilterKind) (db.FilterKind, error)

func FilterValueFromJSON

func FilterValueFromJSON(f OrderFilter) (interface{}, error)

FilterValueFromJSON converts the filter value from the JSON type to the corresponding Go type. It returns an error if the JSON type does not match what was expected based on the filter field.

func FilterValueFromJSONV4

func FilterValueFromJSONV4(f OrderFilterV4) (interface{}, error)

FilterValueFromJSONV4 converts the filter value from the JSON type to the corresponding Go type. It returns an error if the JSON type does not match what was expected based on the filter field.

func FilterValueToJSON

func FilterValueToJSON(f OrderFilter) (string, error)

FilterValueToJSON converts the filter value from a native Go type to the corresponding JSON value. It returns an error if the Go type does not match what was expected based on the filter field.

func NewOrderToSignedOrder

func NewOrderToSignedOrder(newOrder *NewOrder) (*zeroex.SignedOrder, []error)

func NewOrderToSignedOrderV4

func NewOrderToSignedOrderV4(newOrder *NewOrderV4) (*zeroex.SignedOrderV4, []error)

func NewOrdersToSignedOrders

func NewOrdersToSignedOrders(newOrders []*NewOrder) ([]*zeroex.SignedOrder, []error)

func NewOrdersToSignedOrdersV4

func NewOrdersToSignedOrdersV4(newOrders []*NewOrderV4) ([]*zeroex.SignedOrderV4, []error)

func SortDirectionToDBType

func SortDirectionToDBType(direction SortDirection) (db.SortDirection, error)

Types

type AcceptedOrderResult

type AcceptedOrderResult struct {
	// The order that was accepted, including metadata.
	Order *OrderWithMetadata `json:"order"`
	// Whether or not the order is new. Set to true if this is the first time this Mesh node has accepted the order
	// and false otherwise.
	IsNew bool `json:"isNew"`
}

func AcceptedOrderResultFromOrderInfo

func AcceptedOrderResultFromOrderInfo(info *ordervalidator.AcceptedOrderInfo) *AcceptedOrderResult

func AcceptedOrderResultsFromOrderInfos

func AcceptedOrderResultsFromOrderInfos(infos []*ordervalidator.AcceptedOrderInfo) []*AcceptedOrderResult

type AcceptedOrderResultV4

type AcceptedOrderResultV4 struct {
	// The v4 order that was accepted, including metadata.
	Order *OrderV4WithMetadata `json:"order"`
	// Whether or not the order is new. Set to true if this is the first time this Mesh node has accepted the order
	// and false otherwise.
	IsNew bool `json:"isNew"`
}

func AcceptedOrderResultFromOrderInfoV4

func AcceptedOrderResultFromOrderInfoV4(info *ordervalidator.AcceptedOrderInfo) *AcceptedOrderResultV4

func AcceptedOrderResultsFromOrderInfosV4

func AcceptedOrderResultsFromOrderInfosV4(infos []*ordervalidator.AcceptedOrderInfo) []*AcceptedOrderResultV4

type AddOrdersOpts

type AddOrdersOpts struct {
	// Indicates that the orders being added should be kept by the database after
	// cancellation.
	KeepCancelled *bool `json:"keepCancelled"`
	// Indicates that the orders being added should be kept by the database after
	// expiry.
	KeepExpired *bool `json:"keepExpired"`
	// Indicates that the orders being added should be kept by the database after
	// being fully filled.
	KeepFullyFilled *bool `json:"keepFullyFilled"`
	// Indicates that the orders being added should be kept by the database after
	// becoming unfunded.
	KeepUnfunded *bool `json:"keepUnfunded"`
}

type AddOrdersResults

type AddOrdersResults struct {
	// The set of orders that were accepted. Accepted orders will be watched and order events will be emitted if
	// their status changes.
	Accepted []*AcceptedOrderResult `json:"accepted"`
	// The set of orders that were rejected, including the reason they were rejected. Rejected orders will not be
	// watched.
	Rejected []*RejectedOrderResult `json:"rejected"`
}

The results of the addOrders mutation. Includes which orders were accepted and which orders where rejected.

func AddOrdersResultsFromValidationResults

func AddOrdersResultsFromValidationResults(validationResults *ordervalidator.ValidationResults) (*AddOrdersResults, error)

type AddOrdersResultsV4

type AddOrdersResultsV4 struct {
	// The set of orders that were accepted. Accepted orders will be watched and order events will be emitted if
	// their status changes.
	Accepted []*AcceptedOrderResultV4 `json:"accepted"`
	// The set of orders that were rejected, including the reason they were rejected. Rejected orders will not be
	// watched.
	Rejected []*RejectedOrderResultV4 `json:"rejected"`
}

The results of the addOrdersV4 mutation. Includes which orders were accepted and which orders where rejected.

func AddOrdersResultsFromValidationResultsV4

func AddOrdersResultsFromValidationResultsV4(validationResults *ordervalidator.ValidationResults) (*AddOrdersResultsV4, error)

type ContractEvent

type ContractEvent struct {
	// The hash of the block where the event was generated.
	BlockHash string `json:"blockHash"`
	// The hash of the transaction where the event was generated.
	TxHash string `json:"txHash"`
	// The index of the transaction where the event was generated.
	TxIndex int `json:"txIndex"`
	// The index of the event log.
	LogIndex int `json:"logIndex"`
	// True when this was an event that was removed due to a block-reorg. False otherwise.
	IsRemoved bool `json:"isRemoved"`
	// The address of the contract that generated the event.
	Address string `json:"address"`
	// The kind of event (e.g. "ERC20TransferEvent").
	Kind string `json:"kind"`
	// The parameters for the event. The parameters are different for each event kind, but will always
	// be a set of key-value pairs.
	Parameters interface{} `json:"parameters"`
}

An on-chain contract event.

func ContractEventFromZeroExType

func ContractEventFromZeroExType(event *zeroex.ContractEvent) *ContractEvent

func ContractEventsFromZeroExType

func ContractEventsFromZeroExType(events []*zeroex.ContractEvent) []*ContractEvent

type FilterKind

type FilterKind string

The kind of comparison to be used in a filter.

const (
	FilterKindEqual          FilterKind = "EQUAL"
	FilterKindNotEqual       FilterKind = "NOT_EQUAL"
	FilterKindGreater        FilterKind = "GREATER"
	FilterKindGreaterOrEqual FilterKind = "GREATER_OR_EQUAL"
	FilterKindLess           FilterKind = "LESS"
	FilterKindLessOrEqual    FilterKind = "LESS_OR_EQUAL"
)

func (FilterKind) IsValid

func (e FilterKind) IsValid() bool

func (FilterKind) MarshalGQL

func (e FilterKind) MarshalGQL(w io.Writer)

func (FilterKind) String

func (e FilterKind) String() string

func (*FilterKind) UnmarshalGQL

func (e *FilterKind) UnmarshalGQL(v interface{}) error

type LatestBlock

type LatestBlock struct {
	// The block number encoded as a numerical string.
	Number string `json:"number"`
	// The block hash encoded as a hexadecimal string.
	Hash string `json:"hash"`
}

The block number and block hash for the latest block that has been processed by Mesh.

func LatestBlockFromCommonType

func LatestBlockFromCommonType(latestBlock types.LatestBlock) *LatestBlock

type NewOrder

type NewOrder struct {
	ChainID               string `json:"chainId"`
	ExchangeAddress       string `json:"exchangeAddress"`
	MakerAddress          string `json:"makerAddress"`
	MakerAssetData        string `json:"makerAssetData"`
	MakerAssetAmount      string `json:"makerAssetAmount"`
	MakerFeeAssetData     string `json:"makerFeeAssetData"`
	MakerFee              string `json:"makerFee"`
	TakerAddress          string `json:"takerAddress"`
	TakerAssetData        string `json:"takerAssetData"`
	TakerAssetAmount      string `json:"takerAssetAmount"`
	TakerFeeAssetData     string `json:"takerFeeAssetData"`
	TakerFee              string `json:"takerFee"`
	SenderAddress         string `json:"senderAddress"`
	FeeRecipientAddress   string `json:"feeRecipientAddress"`
	ExpirationTimeSeconds string `json:"expirationTimeSeconds"`
	Salt                  string `json:"salt"`
	Signature             string `json:"signature"`
}

A signed 0x order according to the [protocol specification](https://github.com/0xProject/0x-protocol-specification/blob/master/v3/v3-specification.md#order-message-format).

func NewOrderFromSignedOrder

func NewOrderFromSignedOrder(signedOrder *zeroex.SignedOrder) *NewOrder

func NewOrdersFromSignedOrders

func NewOrdersFromSignedOrders(signedOrders []*zeroex.SignedOrder) []*NewOrder

type NewOrderV4

type NewOrderV4 struct {
	ChainID             string `json:"chainId"`
	VerifyingContract   string `json:"verifyingContract"`
	MakerToken          string `json:"makerToken"`
	TakerToken          string `json:"takerToken"`
	MakerAmount         string `json:"makerAmount"`
	TakerAmount         string `json:"takerAmount"`
	TakerTokenFeeAmount string `json:"takerTokenFeeAmount"`
	Maker               string `json:"maker"`
	Taker               string `json:"taker"`
	Sender              string `json:"sender"`
	FeeRecipient        string `json:"feeRecipient"`
	Pool                string `json:"pool"`
	Expiry              string `json:"expiry"`
	Salt                string `json:"salt"`
	SignatureType       string `json:"signatureType"`
	SignatureV          string `json:"signatureV"`
	SignatureR          string `json:"signatureR"`
	SignatureS          string `json:"signatureS"`
}

A signed v4 0x order according to the [protocol specification](https://github.com/0xProject/0x-protocol-specification/blob/master/v3/v3-specification.md#order-message-format).

func NewOrderFromSignedOrderV4

func NewOrderFromSignedOrderV4(signedOrder *zeroex.SignedOrderV4) *NewOrderV4

func NewOrdersFromSignedOrdersV4

func NewOrdersFromSignedOrdersV4(signedOrders []*zeroex.SignedOrderV4) []*NewOrderV4

type Order

type Order struct {
	ChainID               string `json:"chainId"`
	ExchangeAddress       string `json:"exchangeAddress"`
	MakerAddress          string `json:"makerAddress"`
	MakerAssetData        string `json:"makerAssetData"`
	MakerAssetAmount      string `json:"makerAssetAmount"`
	MakerFeeAssetData     string `json:"makerFeeAssetData"`
	MakerFee              string `json:"makerFee"`
	TakerAddress          string `json:"takerAddress"`
	TakerAssetData        string `json:"takerAssetData"`
	TakerAssetAmount      string `json:"takerAssetAmount"`
	TakerFeeAssetData     string `json:"takerFeeAssetData"`
	TakerFee              string `json:"takerFee"`
	SenderAddress         string `json:"senderAddress"`
	FeeRecipientAddress   string `json:"feeRecipientAddress"`
	ExpirationTimeSeconds string `json:"expirationTimeSeconds"`
	Salt                  string `json:"salt"`
	Signature             string `json:"signature"`
}

A signed 0x order according to the [protocol specification](https://github.com/0xProject/0x-protocol-specification/blob/master/v3/v3-specification.md#order-message-format.)

type OrderEndState

type OrderEndState string
const (
	// The order was successfully validated and added to the Mesh node. The order is now being watched and any changes to
	// the fillability will result in subsequent order events.
	OrderEndStateAdded OrderEndState = "ADDED"
	// The order was filled for a partial amount. The order is still fillable up to the fillableTakerAssetAmount.
	OrderEndStateFilled OrderEndState = "FILLED"
	// The order was fully filled and its remaining fillableTakerAssetAmount is 0. The order is no longer fillable.
	OrderEndStateFullyFilled OrderEndState = "FULLY_FILLED"
	// The order was cancelled and is no longer fillable.
	OrderEndStateCancelled OrderEndState = "CANCELLED"
	// The order expired and is no longer fillable.
	OrderEndStateExpired OrderEndState = "EXPIRED"
	// The order was previously expired, but due to a block re-org it is no longer considered expired (should be rare).
	OrderEndStateUnexpired OrderEndState = "UNEXPIRED"
	// The order has become unfunded and is no longer fillable. This can happen if the maker makes a transfer or changes their allowance.
	OrderEndStateUnfunded OrderEndState = "UNFUNDED"
	// The fillability of the order has increased. This can happen if a previously processed fill event gets reverted due to a block re-org,
	// or if a maker makes a transfer or changes their allowance.
	OrderEndStateFillabilityIncreased OrderEndState = "FILLABILITY_INCREASED"
	// The order is potentially still valid but was removed for a different reason (e.g.
	// the database is full or the peer that sent the order was misbehaving). The order will no longer be watched
	// and no further events for this order will be emitted. In some cases, the order may be re-added in the
	// future.
	OrderEndStateStoppedWatching OrderEndState = "STOPPED_WATCHING"
)

func (OrderEndState) IsValid

func (e OrderEndState) IsValid() bool

func (OrderEndState) MarshalGQL

func (e OrderEndState) MarshalGQL(w io.Writer)

func (OrderEndState) String

func (e OrderEndState) String() string

func (*OrderEndState) UnmarshalGQL

func (e *OrderEndState) UnmarshalGQL(v interface{}) error

type OrderEvent

type OrderEvent struct {
	// The order that was affected.
	Order *OrderWithMetadata `json:"order"`
	// The v4 order that was affected.
	Orderv4 *OrderV4WithMetadata `json:"orderv4"`
	// A way of classifying the effect that the order event had on the order. You can
	// think of different end states as different "types" of order events.
	EndState OrderEndState `json:"endState"`
	// The timestamp for the order event, which can be used for bookkeeping purposes.
	// If the order event was generated as a direct result of on-chain events (e.g., FILLED,
	// UNFUNDED, CANCELED), then it is set to the latest block timestamp at which the order
	// was re-validated. Otherwise (e.g., for ADDED, STOPPED_WATCHING), the timestamp corresponds
	// when the event was generated on the server side.
	Timestamp string `json:"timestamp"`
	// Contains all the contract events that triggered the order to be re-validated.
	// All events that _may_ have affected the state of the order are included here.
	// It is guaranteed that at least one of the events included here will have affected
	// the order's state, but there may also be some false positives.
	ContractEvents []*ContractEvent `json:"contractEvents"`
}

func OrderEventFromZeroExType

func OrderEventFromZeroExType(event *zeroex.OrderEvent) *OrderEvent

func OrderEventsFromZeroExType

func OrderEventsFromZeroExType(orderEvents []*zeroex.OrderEvent) []*OrderEvent

type OrderField

type OrderField string

An enum containing all the order fields for which filters and/or sorting is supported.

const (
	OrderFieldHash                     OrderField = "hash"
	OrderFieldChainID                  OrderField = "chainId"
	OrderFieldExchangeAddress          OrderField = "exchangeAddress"
	OrderFieldMakerAddress             OrderField = "makerAddress"
	OrderFieldMakerAssetData           OrderField = "makerAssetData"
	OrderFieldMakerAssetAmount         OrderField = "makerAssetAmount"
	OrderFieldMakerFeeAssetData        OrderField = "makerFeeAssetData"
	OrderFieldMakerFee                 OrderField = "makerFee"
	OrderFieldTakerAddress             OrderField = "takerAddress"
	OrderFieldTakerAssetData           OrderField = "takerAssetData"
	OrderFieldTakerAssetAmount         OrderField = "takerAssetAmount"
	OrderFieldTakerFeeAssetData        OrderField = "takerFeeAssetData"
	OrderFieldTakerFee                 OrderField = "takerFee"
	OrderFieldSenderAddress            OrderField = "senderAddress"
	OrderFieldFeeRecipientAddress      OrderField = "feeRecipientAddress"
	OrderFieldExpirationTimeSeconds    OrderField = "expirationTimeSeconds"
	OrderFieldSalt                     OrderField = "salt"
	OrderFieldFillableTakerAssetAmount OrderField = "fillableTakerAssetAmount"
)

func (OrderField) IsValid

func (e OrderField) IsValid() bool

func (OrderField) MarshalGQL

func (e OrderField) MarshalGQL(w io.Writer)

func (OrderField) String

func (e OrderField) String() string

func (*OrderField) UnmarshalGQL

func (e *OrderField) UnmarshalGQL(v interface{}) error

type OrderFieldV4

type OrderFieldV4 string

An enum containing all the order fields for which filters and/or sorting is supported.

const (
	OrderFieldV4Hash                     OrderFieldV4 = "hash"
	OrderFieldV4ChainID                  OrderFieldV4 = "chainId"
	OrderFieldV4VerifyingContract        OrderFieldV4 = "verifyingContract"
	OrderFieldV4MakerToken               OrderFieldV4 = "makerToken"
	OrderFieldV4TakerToken               OrderFieldV4 = "takerToken"
	OrderFieldV4MakerAmount              OrderFieldV4 = "makerAmount"
	OrderFieldV4TakerAmount              OrderFieldV4 = "takerAmount"
	OrderFieldV4TakerTokenFeeAmount      OrderFieldV4 = "takerTokenFeeAmount"
	OrderFieldV4Maker                    OrderFieldV4 = "maker"
	OrderFieldV4Taker                    OrderFieldV4 = "taker"
	OrderFieldV4Sender                   OrderFieldV4 = "sender"
	OrderFieldV4FeeRecipient             OrderFieldV4 = "feeRecipient"
	OrderFieldV4Pool                     OrderFieldV4 = "pool"
	OrderFieldV4Expiry                   OrderFieldV4 = "expiry"
	OrderFieldV4Salt                     OrderFieldV4 = "salt"
	OrderFieldV4Signature                OrderFieldV4 = "signature"
	OrderFieldV4FillableTakerAssetAmount OrderFieldV4 = "fillableTakerAssetAmount"
)

func (OrderFieldV4) IsValid

func (e OrderFieldV4) IsValid() bool

func (OrderFieldV4) MarshalGQL

func (e OrderFieldV4) MarshalGQL(w io.Writer)

func (OrderFieldV4) String

func (e OrderFieldV4) String() string

func (*OrderFieldV4) UnmarshalGQL

func (e *OrderFieldV4) UnmarshalGQL(v interface{}) error

type OrderFilter

type OrderFilter struct {
	Field OrderField `json:"field"`
	Kind  FilterKind `json:"kind"`
	// value must match the type of the filter field.
	Value interface{} `json:"value"`
}

A filter on orders. Can be used in queries to only return orders that meet certain criteria.

type OrderFilterV4

type OrderFilterV4 struct {
	Field OrderFieldV4 `json:"field"`
	Kind  FilterKind   `json:"kind"`
	// value must match the type of the filter field.
	Value interface{} `json:"value"`
}

A filter on v4 orders. Can be used in queries to only return orders that meet certain criteria.

type OrderSort

type OrderSort struct {
	Field     OrderField    `json:"field"`
	Direction SortDirection `json:"direction"`
}

A sort ordering for orders. Can be used in queries to control the order in which results are returned.

type OrderSortV4

type OrderSortV4 struct {
	Field     OrderFieldV4  `json:"field"`
	Direction SortDirection `json:"direction"`
}

A sort ordering for v4 orders. Can be used in queries to control the order in which results are returned.

type OrderV4

type OrderV4 struct {
	ChainID             string `json:"chainId"`
	VerifyingContract   string `json:"verifyingContract"`
	MakerToken          string `json:"makerToken"`
	TakerToken          string `json:"takerToken"`
	MakerAmount         string `json:"makerAmount"`
	TakerAmount         string `json:"takerAmount"`
	TakerTokenFeeAmount string `json:"takerTokenFeeAmount"`
	Maker               string `json:"maker"`
	Taker               string `json:"taker"`
	Sender              string `json:"sender"`
	FeeRecipient        string `json:"feeRecipient"`
	Pool                string `json:"pool"`
	Expiry              string `json:"expiry"`
	Salt                string `json:"salt"`
	SignatureType       string `json:"signatureType"`
	SignatureV          string `json:"signatureV"`
	SignatureR          string `json:"signatureR"`
	SignatureS          string `json:"signatureS"`
}

A signed 0x v4 order according to the [protocol specification](https://0xprotocol.readthedocs.io/en/latest/basics/orders.html)

type OrderV4WithMetadata

type OrderV4WithMetadata struct {
	ChainID             string `json:"chainId"`
	VerifyingContract   string `json:"verifyingContract"`
	MakerToken          string `json:"makerToken"`
	TakerToken          string `json:"takerToken"`
	MakerAmount         string `json:"makerAmount"`
	TakerAmount         string `json:"takerAmount"`
	TakerTokenFeeAmount string `json:"takerTokenFeeAmount"`
	Maker               string `json:"maker"`
	Taker               string `json:"taker"`
	Sender              string `json:"sender"`
	FeeRecipient        string `json:"feeRecipient"`
	Pool                string `json:"pool"`
	Expiry              string `json:"expiry"`
	Salt                string `json:"salt"`
	SignatureType       string `json:"signatureType"`
	SignatureV          string `json:"signatureV"`
	SignatureR          string `json:"signatureR"`
	SignatureS          string `json:"signatureS"`
	// The hash, which can be used to uniquely identify an order. Encoded as a hexadecimal string.
	Hash string `json:"hash"`
	// The remaining amount of the maker asset which has not yet been filled. Encoded as a numerical string.
	FillableTakerAssetAmount string `json:"fillableTakerAssetAmount"`
}

A signed 0x v4 order along with some additional metadata about the order which is not part of the 0x protocol specification.

func OrderWithMetadataFromCommonTypeV4

func OrderWithMetadataFromCommonTypeV4(order *types.OrderWithMetadata) *OrderV4WithMetadata

func OrdersWithMetadataFromCommonTypeV4

func OrdersWithMetadataFromCommonTypeV4(orders []*types.OrderWithMetadata) []*OrderV4WithMetadata

type OrderWithMetadata

type OrderWithMetadata struct {
	ChainID               string `json:"chainId"`
	ExchangeAddress       string `json:"exchangeAddress"`
	MakerAddress          string `json:"makerAddress"`
	MakerAssetData        string `json:"makerAssetData"`
	MakerAssetAmount      string `json:"makerAssetAmount"`
	MakerFeeAssetData     string `json:"makerFeeAssetData"`
	MakerFee              string `json:"makerFee"`
	TakerAddress          string `json:"takerAddress"`
	TakerAssetData        string `json:"takerAssetData"`
	TakerAssetAmount      string `json:"takerAssetAmount"`
	TakerFeeAssetData     string `json:"takerFeeAssetData"`
	TakerFee              string `json:"takerFee"`
	SenderAddress         string `json:"senderAddress"`
	FeeRecipientAddress   string `json:"feeRecipientAddress"`
	ExpirationTimeSeconds string `json:"expirationTimeSeconds"`
	Salt                  string `json:"salt"`
	Signature             string `json:"signature"`
	// The hash, which can be used to uniquely identify an order. Encoded as a hexadecimal string.
	Hash string `json:"hash"`
	// The remaining amount of the maker asset which has not yet been filled. Encoded as a numerical string.
	FillableTakerAssetAmount string `json:"fillableTakerAssetAmount"`
}

A signed 0x order along with some additional metadata about the order which is not part of the 0x protocol specification.

func OrderWithMetadataFromCommonType

func OrderWithMetadataFromCommonType(order *types.OrderWithMetadata) *OrderWithMetadata

func OrdersWithMetadataFromCommonType

func OrdersWithMetadataFromCommonType(orders []*types.OrderWithMetadata) []*OrderWithMetadata

type RejectedOrderCode

type RejectedOrderCode string

A set of all possible codes included in RejectedOrderResult.

const (
	RejectedOrderCodeEthRPCRequestFailed              RejectedOrderCode = "ETH_RPC_REQUEST_FAILED"
	RejectedOrderCodeOrderHasInvalidMakerAssetAmount  RejectedOrderCode = "ORDER_HAS_INVALID_MAKER_ASSET_AMOUNT"
	RejectedOrderCodeOrderHasInvalidTakerAssetAmount  RejectedOrderCode = "ORDER_HAS_INVALID_TAKER_ASSET_AMOUNT"
	RejectedOrderCodeOrderExpired                     RejectedOrderCode = "ORDER_EXPIRED"
	RejectedOrderCodeOrderFullyFilled                 RejectedOrderCode = "ORDER_FULLY_FILLED"
	RejectedOrderCodeOrderCancelled                   RejectedOrderCode = "ORDER_CANCELLED"
	RejectedOrderCodeOrderUnfunded                    RejectedOrderCode = "ORDER_UNFUNDED"
	RejectedOrderCodeOrderHasInvalidMakerAssetData    RejectedOrderCode = "ORDER_HAS_INVALID_MAKER_ASSET_DATA"
	RejectedOrderCodeOrderHasInvalidMakerFeeAssetData RejectedOrderCode = "ORDER_HAS_INVALID_MAKER_FEE_ASSET_DATA"
	RejectedOrderCodeOrderHasInvalidTakerAssetData    RejectedOrderCode = "ORDER_HAS_INVALID_TAKER_ASSET_DATA"
	RejectedOrderCodeOrderHasInvalidTakerFeeAssetData RejectedOrderCode = "ORDER_HAS_INVALID_TAKER_FEE_ASSET_DATA"
	RejectedOrderCodeOrderHasInvalidSignature         RejectedOrderCode = "ORDER_HAS_INVALID_SIGNATURE"
	RejectedOrderCodeOrderMaxExpirationExceeded       RejectedOrderCode = "ORDER_MAX_EXPIRATION_EXCEEDED"
	RejectedOrderCodeInternalError                    RejectedOrderCode = "INTERNAL_ERROR"
	RejectedOrderCodeMaxOrderSizeExceeded             RejectedOrderCode = "MAX_ORDER_SIZE_EXCEEDED"
	RejectedOrderCodeOrderAlreadyStoredAndUnfillable  RejectedOrderCode = "ORDER_ALREADY_STORED_AND_UNFILLABLE"
	RejectedOrderCodeOrderForIncorrectChain           RejectedOrderCode = "ORDER_FOR_INCORRECT_CHAIN"
	RejectedOrderCodeIncorrectExchangeAddress         RejectedOrderCode = "INCORRECT_EXCHANGE_ADDRESS"
	RejectedOrderCodeSenderAddressNotAllowed          RejectedOrderCode = "SENDER_ADDRESS_NOT_ALLOWED"
	RejectedOrderCodeDatabaseFullOfOrders             RejectedOrderCode = "DATABASE_FULL_OF_ORDERS"
	RejectedOrderCodeTakerAddressNotAllowed           RejectedOrderCode = "TAKER_ADDRESS_NOT_ALLOWED"
	RejectedOrderCodeOrderInvalidSchema               RejectedOrderCode = "ORDER_INVALID_SCHEMA"
)

func RejectedCodeFromValidatorStatus

func RejectedCodeFromValidatorStatus(status ordervalidator.RejectedOrderStatus) (RejectedOrderCode, error)

func (RejectedOrderCode) IsValid

func (e RejectedOrderCode) IsValid() bool

func (RejectedOrderCode) MarshalGQL

func (e RejectedOrderCode) MarshalGQL(w io.Writer)

func (RejectedOrderCode) String

func (e RejectedOrderCode) String() string

func (*RejectedOrderCode) UnmarshalGQL

func (e *RejectedOrderCode) UnmarshalGQL(v interface{}) error

type RejectedOrderResult

type RejectedOrderResult struct {
	// The hash of the order. May be null if the hash could not be computed.
	Hash *string `json:"hash"`
	// The order that was rejected.
	Order *Order `json:"order"`
	// A machine-readable code indicating why the order was rejected. This code is designed to
	// be used by programs and applications and will never change without breaking backwards-compatibility.
	Code RejectedOrderCode `json:"code"`
	// A human-readable message indicating why the order was rejected. This message may change
	// in future releases and is not covered by backwards-compatibility guarantees.
	Message string `json:"message"`
}

func RejectedOrderResultFromOrderInfo

func RejectedOrderResultFromOrderInfo(info *ordervalidator.RejectedOrderInfo) (*RejectedOrderResult, error)

func RejectedOrderResultsFromOrderInfos

func RejectedOrderResultsFromOrderInfos(infos []*ordervalidator.RejectedOrderInfo) ([]*RejectedOrderResult, error)

type RejectedOrderResultV4

type RejectedOrderResultV4 struct {
	// The hash of the order. May be null if the hash could not be computed.
	Hash *string `json:"hash"`
	// The v4 order that was rejected.
	Order *OrderV4 `json:"order"`
	// A machine-readable code indicating why the order was rejected. This code is designed to
	// be used by programs and applications and will never change without breaking backwards-compatibility.
	Code RejectedOrderCode `json:"code"`
	// A human-readable message indicating why the order was rejected. This message may change
	// in future releases and is not covered by backwards-compatibility guarantees.
	Message string `json:"message"`
}

func RejectedOrderResultFromOrderInfoV4

func RejectedOrderResultFromOrderInfoV4(info *ordervalidator.RejectedOrderInfo) (*RejectedOrderResultV4, error)

func RejectedOrderResultsFromOrderInfosV4

func RejectedOrderResultsFromOrderInfosV4(infos []*ordervalidator.RejectedOrderInfo) ([]*RejectedOrderResultV4, error)

type SortDirection

type SortDirection string

The direction to sort in. Ascending means lowest to highest. Descending means highest to lowest.

const (
	SortDirectionAsc  SortDirection = "ASC"
	SortDirectionDesc SortDirection = "DESC"
)

func (SortDirection) IsValid

func (e SortDirection) IsValid() bool

func (SortDirection) MarshalGQL

func (e SortDirection) MarshalGQL(w io.Writer)

func (SortDirection) String

func (e SortDirection) String() string

func (*SortDirection) UnmarshalGQL

func (e *SortDirection) UnmarshalGQL(v interface{}) error

type Stats

type Stats struct {
	Version                           string       `json:"version"`
	PubSubTopic                       string       `json:"pubSubTopic"`
	Rendezvous                        string       `json:"rendezvous"`
	PeerID                            string       `json:"peerID"`
	EthereumChainID                   int          `json:"ethereumChainID"`
	LatestBlock                       *LatestBlock `json:"latestBlock"`
	NumPeers                          int          `json:"numPeers"`
	NumOrders                         int          `json:"numOrders"`
	NumOrdersV4                       int          `json:"numOrdersV4"`
	NumOrdersIncludingRemoved         int          `json:"numOrdersIncludingRemoved"`
	NumOrdersIncludingRemovedV4       int          `json:"numOrdersIncludingRemovedV4"`
	NumPinnedOrders                   int          `json:"numPinnedOrders"`
	NumPinnedOrdersV4                 int          `json:"numPinnedOrdersV4"`
	StartOfCurrentUTCDay              string       `json:"startOfCurrentUTCDay"`
	EthRPCRequestsSentInCurrentUTCDay int          `json:"ethRPCRequestsSentInCurrentUTCDay"`
	EthRPCRateLimitExpiredRequests    int          `json:"ethRPCRateLimitExpiredRequests"`
	SecondaryRendezvous               []string     `json:"secondaryRendezvous"`
	// The max expiration time expressed as seconds since the Unix Epoch and encoded as a numerical string.
	// Any order with an expiration time greater than this maximum will be rejected by Mesh.
	MaxExpirationTime string `json:"maxExpirationTime"`
}

Contains configuration options and various stats for Mesh.

func StatsFromCommonType

func StatsFromCommonType(stats *types.Stats) *Stats

Jump to

Keyboard shortcuts

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