models

package module
v0.0.0-...-c387957 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 3 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseRequest

type BaseRequest struct {
	Action string `json:"action"`
}

RPC requests

var SendAction BaseRequest = BaseRequest{Action: "send"}

send

type ClientMessage

type ClientMessage struct {
	// Exclude this field from serialization (don't expose requester email to client)
	RequesterEmail string      `json:"-"`
	BlockAward     bool        `json:"-"`
	MessageType    MessageType `json:"request_type"`
	// We attach a unique request ID to each request, this links it to user requesting work
	RequestID            string `json:"request_id"`
	Hash                 string `json:"hash"`
	DifficultyMultiplier int    `json:"difficulty_multiplier"`
	// Awarded info
	ProviderEmail  string  `json:"-"`
	PercentOfPool  float64 `json:"percent_of_pool"`
	EstimatedAward float64 `json:"estimated_award"`
	Precache       bool    `json:"precache"`
}

Message sent from server -> client

type ClientWorkResponse

type ClientWorkResponse struct {
	RequestID string `json:"request_id"`
	Hash      string `json:"hash"`
	Result    string `json:"result"`
}

Work response sent from client -> server

type MessageType

type MessageType string
const (
	WorkGenerate MessageType = "work_generate"
	WorkCancel   MessageType = "work_cancel"
	BlockAwarded MessageType = "block_awarded"
)

type SendRequest

type SendRequest struct {
	BaseRequest
	Wallet      string    `json:"wallet"`
	Source      string    `json:"source"`
	Destination string    `json:"destination"`
	AmountRaw   string    `json:"amount"`
	ID          string    `json:"id"`
	PaidTo      uuid.UUID `json:"-"`
}

func (*SendRequest) Scan

func (j *SendRequest) Scan(value interface{}) error

func (SendRequest) Value

func (j SendRequest) Value() (driver.Value, error)

Type of nano payment object as JSONB

type SendResponse

type SendResponse struct {
	Block string `json:"block"`
}

Jump to

Keyboard shortcuts

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