messages

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: AGPL-3.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MuSigStartV1MessageName            = "musig_initialize/v1"
	MuSigTerminateV1MessageName        = "musig_terminate/v1"
	MuSigCommitmentV1MessageName       = "musig_commitment/v1"
	MuSigPartialSignatureV1MessageName = "musig_partial_signature/v1"
	MuSigSignatureV1MessageName        = "musig_signature/v1"
)
View Source
const DataPointV1MessageName = "data_point/v1"
View Source
const EventV1MessageName = "event/v1"
View Source
const PriceV0MessageName = "price/v0"

Deprecated: use DataPointV1MessageName instead.

View Source
const PriceV1MessageName = "price/v1"

Deprecated: use DataPointV1MessageName instead.

Variables

View Source
var (
	ErrPriceMessageTooLarge       = errors.New("price message too large")
	ErrUnknownPriceMessageVersion = errors.New("unknown message version")
	ErrInvalidPriceMessage        = errors.New("invalid price message")
)
View Source
var ErrEventMessageTooLarge = errors.New("event message too large")

Functions

This section is empty.

Types

type DataPoint added in v0.11.0

type DataPoint struct {
	// Model of the data point.
	Model string `json:"model"`

	// Value is a binary representation of the data point.
	Value datapoint.Point `json:"value"`

	Signature types.Signature `json:"signature"`
}

func (*DataPoint) Marshall added in v0.11.4

func (d *DataPoint) Marshall() ([]byte, error)

func (*DataPoint) MarshallBinary added in v0.11.0

func (d *DataPoint) MarshallBinary() ([]byte, error)

MarshallBinary implements the transport.Message interface.

func (*DataPoint) Unmarshall added in v0.11.4

func (d *DataPoint) Unmarshall(b []byte) error

func (*DataPoint) UnmarshallBinary added in v0.11.0

func (d *DataPoint) UnmarshallBinary(data []byte) error

UnmarshallBinary implements the transport.Message interface.

type Event

type Event struct {
	// Type of the event.
	Type string

	// Unique ID of the event.
	ID []byte

	// Event index used to search for events.
	Index []byte

	// The date of the event.
	EventDate time.Time

	// The date when the event message was created.
	MessageDate time.Time

	// List of event data.
	Data map[string][]byte

	// List of event signatures.
	Signatures map[string]EventSignature
}

func (*Event) Copy added in v0.7.1

func (e *Event) Copy() *Event

Copy returns a copy of the event.

func (*Event) MarshallBinary

func (e *Event) MarshallBinary() ([]byte, error)

MarshallBinary implements the transport.Message interface.

func (*Event) UnmarshallBinary

func (e *Event) UnmarshallBinary(data []byte) error

UnmarshallBinary implements the transport.Message interface.

type EventSignature added in v0.4.2

type EventSignature struct {
	Signer    []byte
	Signature []byte
}

type MuSigCommitment added in v0.11.0

type MuSigCommitment struct {
	// Unique SessionID of the MuSig session.
	SessionID [32]byte

	CommitmentKeyX *big.Int
	CommitmentKeyY *big.Int

	PublicKeyX *big.Int
	PublicKeyY *big.Int
}

func (*MuSigCommitment) MarshallBinary added in v0.11.0

func (m *MuSigCommitment) MarshallBinary() ([]byte, error)

func (*MuSigCommitment) UnmarshallBinary added in v0.11.0

func (m *MuSigCommitment) UnmarshallBinary(bytes []byte) error

type MuSigInitialize added in v0.11.0

type MuSigInitialize struct {
	// SessionID is the unique ID of the MuSig session.
	SessionID [32]byte

	// CreatedAt is the time when the session was started.
	StartedAt time.Time

	// Type of the message that will be signed.
	MsgType string

	// Message body that will be signed.
	MsgBody types.Hash

	// Meta is a map of metadata that may be necessary to verify the message.
	MsgMeta map[string][]byte

	// Signers is a list of signers that will participate in the MuSig session.
	Signers []types.Address
}

func (*MuSigInitialize) MarshallBinary added in v0.11.0

func (m *MuSigInitialize) MarshallBinary() ([]byte, error)

func (*MuSigInitialize) UnmarshallBinary added in v0.11.0

func (m *MuSigInitialize) UnmarshallBinary(bytes []byte) (err error)

type MuSigPartialSignature added in v0.11.0

type MuSigPartialSignature struct {
	// Unique SessionID of the MuSig session.
	SessionID [32]byte

	// Partial signature of the MuSig session.
	PartialSignature *big.Int
}

func (*MuSigPartialSignature) MarshallBinary added in v0.11.0

func (m *MuSigPartialSignature) MarshallBinary() ([]byte, error)

func (*MuSigPartialSignature) UnmarshallBinary added in v0.11.0

func (m *MuSigPartialSignature) UnmarshallBinary(bytes []byte) error

type MuSigSignature added in v0.11.0

type MuSigSignature struct {
	// Unique SessionID of the MuSig session.
	SessionID [32]byte

	// Type of the data that was signed.
	MsgType string

	// Data that was signed.
	MsgBody types.Hash

	// Commitment of the MuSig session.
	Commitment types.Address

	// SchnorrSignature is a MuSig Schnorr signature calculated from the partial
	// signatures of all participants.
	SchnorrSignature *big.Int

	// ECDSASignature is a ECDSA signature calculated by the MuSig session
	// coordinator.
	ECDSASignature types.Signature
}

func (*MuSigSignature) MarshallBinary added in v0.11.0

func (m *MuSigSignature) MarshallBinary() ([]byte, error)

func (*MuSigSignature) UnmarshallBinary added in v0.11.0

func (m *MuSigSignature) UnmarshallBinary(bytes []byte) error

type MuSigTerminate added in v0.11.0

type MuSigTerminate struct {
	// Unique SessionID of the MuSig session.
	SessionID [32]byte

	// Reason for terminating the MuSig session.
	Reason string
}

func (*MuSigTerminate) MarshallBinary added in v0.11.0

func (m *MuSigTerminate) MarshallBinary() ([]byte, error)

func (*MuSigTerminate) UnmarshallBinary added in v0.11.0

func (m *MuSigTerminate) UnmarshallBinary(bytes []byte) error

type Price

type Price struct {
	Price   *median.Price   `json:"price"`
	Trace   json.RawMessage `json:"trace"`
	Version string          `json:"version,omitempty"` // TODO: this should move to some meta field e.g. `feedVersion`
	// contains filtered or unexported fields
}

Price is a message that contains a price and a trace of the price. Deprecated: move to datapoint/v1 message.

func (*Price) AsV0 added in v0.6.0

func (p *Price) AsV0() *Price

func (*Price) AsV1 added in v0.6.0

func (p *Price) AsV1() *Price

func (*Price) Marshall

func (p *Price) Marshall() ([]byte, error)

func (*Price) MarshallBinary

func (p *Price) MarshallBinary() ([]byte, error)

MarshallBinary implements the transport.Message interface.

func (*Price) Unmarshall

func (p *Price) Unmarshall(b []byte) error

func (*Price) UnmarshallBinary

func (p *Price) UnmarshallBinary(data []byte) error

UnmarshallBinary implements the transport.Message interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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