sharedDemoContracts

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Envelope

type Envelope struct {
	MessageType string `json:"message_type"`
	Payload     string `json:"payload"`
}

func (*Envelope) New

func (env *Envelope) New(messageType string, payload ISerializableMessage) *Envelope

type ISerializableMessage

type ISerializableMessage interface {
	ToJson() string
	ToBytes() []byte
}

type OrderConfirmed

type OrderConfirmed struct {
	Id        int     `json:"id"`
	Price     float64 `json:"price"`
	Timestamp uint64  `json:"timestamp"`
}

func (*OrderConfirmed) ToBytes

func (order *OrderConfirmed) ToBytes() []byte

func (*OrderConfirmed) ToJson

func (order *OrderConfirmed) ToJson() string

type OrderCreated

type OrderCreated struct {
	Id           int     `json:"id"`
	CurrencyPair string  `json:"currency_pair"`
	Price        float64 `json:"price"`
	Quantity     float64 `json:"quantity"`
	Side         string  `json:"side"`
	Timestamp    uint64  `json:"timestamp"`
}

func (*OrderCreated) ToBytes

func (order *OrderCreated) ToBytes() []byte

func (*OrderCreated) ToJson

func (order *OrderCreated) ToJson() string

type OrderRejected

type OrderRejected struct {
	Id        int    `json:"id"`
	Timestamp uint64 `json:"timestamp"`
	Reason    string `json:"reason"`
}

func (*OrderRejected) ToBytes

func (order *OrderRejected) ToBytes() []byte

func (*OrderRejected) ToJson

func (order *OrderRejected) ToJson() string

Jump to

Keyboard shortcuts

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