common

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SwapCreateProposalSubject   = chanPrefix + "Swap.CreateProposal"
	SwapInfoProposalSubject     = chanPrefix + "Swap.InfoProposal"
	SwapFinalizeProposalSubject = chanPrefix + "Swap.FinalizeProposal"
	SwapAcceptProposalSubject   = chanPrefix + "Swap.AcceptProposal"
)
View Source
const (
	AssetIDLength = 64

	DefaultFeeRate = 150 / 100000000.0 // BTC/Kb
	MinumumFeeRate = 150 / 100000000.0 // BTC/Kb

	AmountPrecision       = 8
	AmountPrecisionFormat = "%.8f"
)

Variables

View Source
var (
	ErrInvalidAddress  = errors.New("Invalid Address")
	ErrInvalidProposal = errors.New("Invalid Proposal")
	ErrInvalidPayload  = errors.New("Invalid PayLoad")
)

Functions

This section is empty.

Types

type AssetID

type AssetID string

type ConfidentialAddress

type ConfidentialAddress string

type Payload

type Payload string

func (Payload) Stdin

func (payload Payload) Stdin() io.Reader

func (Payload) Valid

func (payload Payload) Valid() bool

type ProposalInfo

type ProposalInfo struct {
	ProposerAsset  AssetID
	ProposerAmount float64
	ReceiverAsset  AssetID
	ReceiverAmount float64
}

func (*ProposalInfo) Args

func (p *ProposalInfo) Args() []string

func (*ProposalInfo) Valid

func (p *ProposalInfo) Valid() bool

type SwapProposal

type SwapProposal struct {
	Timestamp time.Time
	SwapID    uint64
	Address   ConfidentialAddress
	Proposal  ProposalInfo
	FeeRate   float64
	Payload   Payload
}

func (*SwapProposal) Decode

func (p *SwapProposal) Decode(data []byte) error

func (*SwapProposal) Encode

func (p *SwapProposal) Encode() ([]byte, error)

Jump to

Keyboard shortcuts

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