Documentation ¶
Index ¶
- Constants
- func NewMessageHandler(svc StakingService, logger *slog.Logger) p2p.MessageStreamHandler
- type AccountStatus
- func (a *AccountStatus) Compare(b *AccountStatus) int
- func (v *AccountStatus) Copy() *AccountStatus
- func (v *AccountStatus) CopyAsInterface() interface{}
- func (v *AccountStatus) Equal(u *AccountStatus) bool
- func (v *AccountStatus) IsValid() error
- func (v *AccountStatus) MarshalBinary() ([]byte, error)
- func (v *AccountStatus) MarshalJSON() ([]byte, error)
- func (v *AccountStatus) UnmarshalBinary(data []byte) error
- func (v *AccountStatus) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *AccountStatus) UnmarshalJSON(data []byte) error
- type AccountStatusOptions
- func (v *AccountStatusOptions) Copy() *AccountStatusOptions
- func (v *AccountStatusOptions) CopyAsInterface() interface{}
- func (v *AccountStatusOptions) Equal(u *AccountStatusOptions) bool
- func (v *AccountStatusOptions) IsValid() error
- func (v *AccountStatusOptions) MarshalBinary() ([]byte, error)
- func (v *AccountStatusOptions) UnmarshalBinary(data []byte) error
- func (v *AccountStatusOptions) UnmarshalBinaryFrom(rd io.Reader) error
- type AccountStatusRequest
- func (v *AccountStatusRequest) Copy() *AccountStatusRequest
- func (v *AccountStatusRequest) CopyAsInterface() interface{}
- func (v *AccountStatusRequest) Equal(u *AccountStatusRequest) bool
- func (v *AccountStatusRequest) IsValid() error
- func (v *AccountStatusRequest) MarshalBinary() ([]byte, error)
- func (v *AccountStatusRequest) MarshalJSON() ([]byte, error)
- func (*AccountStatusRequest) Type() MessageType
- func (v *AccountStatusRequest) UnmarshalBinary(data []byte) error
- func (v *AccountStatusRequest) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *AccountStatusRequest) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *AccountStatusRequest) UnmarshalJSON(data []byte) error
- type AccountStatusResponse
- func (v *AccountStatusResponse) Copy() *AccountStatusResponse
- func (v *AccountStatusResponse) CopyAsInterface() interface{}
- func (v *AccountStatusResponse) Equal(u *AccountStatusResponse) bool
- func (v *AccountStatusResponse) IsValid() error
- func (v *AccountStatusResponse) MarshalBinary() ([]byte, error)
- func (v *AccountStatusResponse) MarshalJSON() ([]byte, error)
- func (*AccountStatusResponse) Type() MessageType
- func (v *AccountStatusResponse) UnmarshalBinary(data []byte) error
- func (v *AccountStatusResponse) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *AccountStatusResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *AccountStatusResponse) UnmarshalJSON(data []byte) error
- type Message
- type MessageClient
- type MessageType
- type StakingService
- type TxWhen
- func (v *TxWhen) Copy() *TxWhen
- func (v *TxWhen) CopyAsInterface() interface{}
- func (v *TxWhen) Equal(u *TxWhen) bool
- func (v *TxWhen) IsValid() error
- func (v *TxWhen) MarshalBinary() ([]byte, error)
- func (v *TxWhen) UnmarshalBinary(data []byte) error
- func (v *TxWhen) UnmarshalBinaryFrom(rd io.Reader) error
Constants ¶
View Source
const ServiceTypeStaking api.ServiceType = 0xF100
Variables ¶
This section is empty.
Functions ¶
func NewMessageHandler ¶
func NewMessageHandler(svc StakingService, logger *slog.Logger) p2p.MessageStreamHandler
Types ¶
type AccountStatus ¶
type AccountStatus struct { Account *types.Account `json:"account,omitempty" form:"account" query:"account" validate:"required"` Balance *big.Int `json:"balance,omitempty" form:"balance" query:"balance" validate:"required"` Deposits *big.Int `json:"deposits,omitempty" form:"deposits" query:"deposits" validate:"required"` Registered *url.TxID `json:"registered,omitempty" form:"registered" query:"registered" validate:"required"` Staked *TxWhen `json:"staked,omitempty" form:"staked" query:"staked" validate:"required"` LastChange *TxWhen `json:"lastChange,omitempty" form:"lastChange" query:"lastChange" validate:"required"` // contains filtered or unexported fields }
func (*AccountStatus) Compare ¶
func (a *AccountStatus) Compare(b *AccountStatus) int
func (*AccountStatus) Copy ¶
func (v *AccountStatus) Copy() *AccountStatus
func (*AccountStatus) CopyAsInterface ¶
func (v *AccountStatus) CopyAsInterface() interface{}
func (*AccountStatus) Equal ¶
func (v *AccountStatus) Equal(u *AccountStatus) bool
func (*AccountStatus) IsValid ¶
func (v *AccountStatus) IsValid() error
func (*AccountStatus) MarshalBinary ¶
func (v *AccountStatus) MarshalBinary() ([]byte, error)
func (*AccountStatus) MarshalJSON ¶
func (v *AccountStatus) MarshalJSON() ([]byte, error)
func (*AccountStatus) UnmarshalBinary ¶
func (v *AccountStatus) UnmarshalBinary(data []byte) error
func (*AccountStatus) UnmarshalBinaryFrom ¶
func (v *AccountStatus) UnmarshalBinaryFrom(rd io.Reader) error
func (*AccountStatus) UnmarshalJSON ¶
func (v *AccountStatus) UnmarshalJSON(data []byte) error
type AccountStatusOptions ¶
type AccountStatusOptions struct {
// contains filtered or unexported fields
}
func (*AccountStatusOptions) Copy ¶
func (v *AccountStatusOptions) Copy() *AccountStatusOptions
func (*AccountStatusOptions) CopyAsInterface ¶
func (v *AccountStatusOptions) CopyAsInterface() interface{}
func (*AccountStatusOptions) Equal ¶
func (v *AccountStatusOptions) Equal(u *AccountStatusOptions) bool
func (*AccountStatusOptions) IsValid ¶
func (v *AccountStatusOptions) IsValid() error
func (*AccountStatusOptions) MarshalBinary ¶
func (v *AccountStatusOptions) MarshalBinary() ([]byte, error)
func (*AccountStatusOptions) UnmarshalBinary ¶
func (v *AccountStatusOptions) UnmarshalBinary(data []byte) error
func (*AccountStatusOptions) UnmarshalBinaryFrom ¶
func (v *AccountStatusOptions) UnmarshalBinaryFrom(rd io.Reader) error
type AccountStatusRequest ¶
type AccountStatusRequest struct { AccountStatusOptions Account *url.URL `json:"account,omitempty" form:"account" query:"account" validate:"required"` // contains filtered or unexported fields }
func (*AccountStatusRequest) Copy ¶
func (v *AccountStatusRequest) Copy() *AccountStatusRequest
func (*AccountStatusRequest) CopyAsInterface ¶
func (v *AccountStatusRequest) CopyAsInterface() interface{}
func (*AccountStatusRequest) Equal ¶
func (v *AccountStatusRequest) Equal(u *AccountStatusRequest) bool
func (*AccountStatusRequest) IsValid ¶
func (v *AccountStatusRequest) IsValid() error
func (*AccountStatusRequest) MarshalBinary ¶
func (v *AccountStatusRequest) MarshalBinary() ([]byte, error)
func (*AccountStatusRequest) MarshalJSON ¶
func (v *AccountStatusRequest) MarshalJSON() ([]byte, error)
func (*AccountStatusRequest) Type ¶
func (*AccountStatusRequest) Type() MessageType
func (*AccountStatusRequest) UnmarshalBinary ¶
func (v *AccountStatusRequest) UnmarshalBinary(data []byte) error
func (*AccountStatusRequest) UnmarshalBinaryFrom ¶
func (v *AccountStatusRequest) UnmarshalBinaryFrom(rd io.Reader) error
func (*AccountStatusRequest) UnmarshalFieldsFrom ¶
func (v *AccountStatusRequest) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*AccountStatusRequest) UnmarshalJSON ¶
func (v *AccountStatusRequest) UnmarshalJSON(data []byte) error
type AccountStatusResponse ¶
type AccountStatusResponse struct { Value *AccountStatus `json:"value,omitempty" form:"value" query:"value" validate:"required"` // contains filtered or unexported fields }
func (*AccountStatusResponse) Copy ¶
func (v *AccountStatusResponse) Copy() *AccountStatusResponse
func (*AccountStatusResponse) CopyAsInterface ¶
func (v *AccountStatusResponse) CopyAsInterface() interface{}
func (*AccountStatusResponse) Equal ¶
func (v *AccountStatusResponse) Equal(u *AccountStatusResponse) bool
func (*AccountStatusResponse) IsValid ¶
func (v *AccountStatusResponse) IsValid() error
func (*AccountStatusResponse) MarshalBinary ¶
func (v *AccountStatusResponse) MarshalBinary() ([]byte, error)
func (*AccountStatusResponse) MarshalJSON ¶
func (v *AccountStatusResponse) MarshalJSON() ([]byte, error)
func (*AccountStatusResponse) Type ¶
func (*AccountStatusResponse) Type() MessageType
func (*AccountStatusResponse) UnmarshalBinary ¶
func (v *AccountStatusResponse) UnmarshalBinary(data []byte) error
func (*AccountStatusResponse) UnmarshalBinaryFrom ¶
func (v *AccountStatusResponse) UnmarshalBinaryFrom(rd io.Reader) error
func (*AccountStatusResponse) UnmarshalFieldsFrom ¶
func (v *AccountStatusResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*AccountStatusResponse) UnmarshalJSON ¶
func (v *AccountStatusResponse) UnmarshalJSON(data []byte) error
type MessageClient ¶
func (*MessageClient) AccountStatus ¶
func (c *MessageClient) AccountStatus(ctx context.Context, account *url.URL, opts AccountStatusOptions) (*AccountStatus, error)
AccountStatus implements api.StakingService.AccountStatus.
type MessageType ¶
const (
MessageTypeAccountStatusRequest MessageType = 0xF101 + iota
)
Request types
const (
MessageTypeAccountStatusResponse MessageType = 0xF121 + iota
)
Response types
type StakingService ¶
type StakingService interface {
AccountStatus(context.Context, *url.URL, AccountStatusOptions) (*AccountStatus, error)
}
type TxWhen ¶
type TxWhen struct { TxID *url.TxID `json:"txID,omitempty" form:"txID" query:"txID" validate:"required"` Executed *light.EventMetadata `json:"executed,omitempty" form:"executed" query:"executed" validate:"required"` MajorBlock uint64 `json:"majorBlock,omitempty" form:"majorBlock" query:"majorBlock" validate:"required"` // contains filtered or unexported fields }
func (*TxWhen) CopyAsInterface ¶
func (v *TxWhen) CopyAsInterface() interface{}
func (*TxWhen) MarshalBinary ¶
func (*TxWhen) UnmarshalBinary ¶
Click to show internal directories.
Click to hide internal directories.