Documentation ¶
Index ¶
- func CreateOrderPlaceMessage(ctx sdk.Context, order clobtypes.Order) (message msgsender.Message, success bool)
- func CreateOrderRemoveMessage(ctx sdk.Context, orderId clobtypes.OrderId, orderStatus clobtypes.OrderStatus, ...) (message msgsender.Message, success bool)
- func CreateOrderRemoveMessageWithDefaultReason(ctx sdk.Context, orderId clobtypes.OrderId, orderStatus clobtypes.OrderStatus, ...) (message msgsender.Message, success bool)
- func CreateOrderRemoveMessageWithReason(ctx sdk.Context, orderId clobtypes.OrderId, ...) (message msgsender.Message, success bool)
- func CreateOrderUpdateMessage(ctx sdk.Context, orderId clobtypes.OrderId, totalFilled satypes.BaseQuantums) (message msgsender.Message, success bool)
- func GetOrderIdHash(orderId clobtypes.OrderId) ([]byte, error)
- func MustCreateOrderPlaceMessage(ctx sdk.Context, order clobtypes.Order) msgsender.Message
- func MustCreateOrderRemoveMessage(ctx sdk.Context, orderId clobtypes.OrderId, orderStatus clobtypes.OrderStatus, ...) msgsender.Message
- func MustCreateOrderRemoveMessageWithReason(ctx sdk.Context, orderId clobtypes.OrderId, ...) msgsender.Message
- func MustCreateOrderUpdateMessage(ctx sdk.Context, orderId clobtypes.OrderId, totalFilled satypes.BaseQuantums) msgsender.Message
- func ShouldSendOrderRemovalOnReplay(orderError error) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateOrderPlaceMessage ¶
func CreateOrderPlaceMessage( ctx sdk.Context, order clobtypes.Order, ) (message msgsender.Message, success bool)
CreateOrderPlaceMessage creates an off-chain update message for an order.
func CreateOrderRemoveMessage ¶
func CreateOrderRemoveMessage( ctx sdk.Context, orderId clobtypes.OrderId, orderStatus clobtypes.OrderStatus, orderError error, removalStatus ocutypes.OrderRemoveV1_OrderRemovalStatus, ) (message msgsender.Message, success bool)
CreateOrderRemoveMessage creates an off-chain update message for an order being removed, with the order's status and the resulting removal status of the removed order.
func CreateOrderRemoveMessageWithDefaultReason ¶
func CreateOrderRemoveMessageWithDefaultReason( ctx sdk.Context, orderId clobtypes.OrderId, orderStatus clobtypes.OrderStatus, orderError error, removalStatus ocutypes.OrderRemoveV1_OrderRemovalStatus, defaultRemovalReason sharedtypes.OrderRemovalReason, ) (message msgsender.Message, success bool)
CreateOrderRemoveMessageWithDefaultReason creates an off-chain update message for an order being removed with the resulting removal status of the removed order. It attempts to look up the removal reason using the given orderStatus & orderError. If the reason cannot be found, it logs an error and falls back to the defaultRemovalReason. If defaultRemovalReason is ...UNSPECIFIED, it panics. TODO(CLOB-1051) take in ctx, not logger
func CreateOrderRemoveMessageWithReason ¶
func CreateOrderRemoveMessageWithReason( ctx sdk.Context, orderId clobtypes.OrderId, reason sharedtypes.OrderRemovalReason, removalStatus ocutypes.OrderRemoveV1_OrderRemovalStatus, ) (message msgsender.Message, success bool)
CreateOrderRemoveMessageWithReason creates an off-chain update message for an order being removed with a specific reason for the removal and the resulting removal status of the removed order.
func CreateOrderUpdateMessage ¶
func CreateOrderUpdateMessage( ctx sdk.Context, orderId clobtypes.OrderId, totalFilled satypes.BaseQuantums, ) (message msgsender.Message, success bool)
CreateOrderUpdateMessage creates an off-chain update message for an order being updated.
func GetOrderIdHash ¶
GetOrderIdHash gets the SHA256 hash of the `IndexerOrderId` mapped from an `OrderId`.
func MustCreateOrderPlaceMessage ¶
MustCreateOrderPlaceMessage invokes CreateOrderPlaceMessage and panics if creation was unsuccessful.
func MustCreateOrderRemoveMessage ¶
func MustCreateOrderRemoveMessage( ctx sdk.Context, orderId clobtypes.OrderId, orderStatus clobtypes.OrderStatus, orderError error, removalStatus ocutypes.OrderRemoveV1_OrderRemovalStatus, ) msgsender.Message
MustCreateOrderRemoveMessage invokes CreateOrderRemoveMessage and panics if creation was unsuccessful.
func MustCreateOrderRemoveMessageWithReason ¶
func MustCreateOrderRemoveMessageWithReason( ctx sdk.Context, orderId clobtypes.OrderId, reason sharedtypes.OrderRemovalReason, removalStatus ocutypes.OrderRemoveV1_OrderRemovalStatus, ) msgsender.Message
MustCreateOrderRemoveMessageWithReason invokes CreateOrderRemoveMessageWithReason and panics if creation was unsuccessful.
func MustCreateOrderUpdateMessage ¶
func MustCreateOrderUpdateMessage( ctx sdk.Context, orderId clobtypes.OrderId, totalFilled satypes.BaseQuantums, ) msgsender.Message
MustCreateOrderUpdateMessage invokes CreateOrderUpdateMessage and panics if creation was unsuccessful.
func ShouldSendOrderRemovalOnReplay ¶
ShouldSendOrderRemovalOnReplay returns a true/false for whether an order removal message should be sent given the error encountered while replaying an order. TODO(CLOB-518): Re-visit enumerating all the errors where an order removal should be / not be sent vs using the existence of an order nonce to determine if an order removal message should be sent.
Types ¶
This section is empty.