bob

package
v0.0.0-...-04e8804 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWrongState          = errors.New("atomic swap is in a state where this action is not permitted")
	ErrOfferExpired        = errors.New("offer has expired")
	ErrAntiSpamNotDetected = errors.New("no sufficient anti spam payment detected")
	ErrAntiSpamReused      = errors.New("new anti spam payment required")
	ErrInvalidRefundSig    = errors.New("unable to build valid refund transaction")
	ErrInvalidDeposit      = errors.New("no suitable deposit recognized")
)

Functions

This section is empty.

Types

type AdaptorDetails

type AdaptorDetails struct {
	BobClaimNoncePoint ed25519.CurvePoint
	AdaptorPubKey      ed25519.CurvePoint
	AdaptorSigBob      []byte
	DepositRecipient   common.Address
}

type AtomicSwap

type AtomicSwap struct {
	ID uuid.UUID
	// contains filtered or unexported fields
}

func NewAtomicSwap

func NewAtomicSwap(trader trader.Trader, ethChain ethereum.Blockchain, siaChain sia.Blockchain,
	blacklist Blacklist, now time.Time) *AtomicSwap

func (*AtomicSwap) AcceptOffer

func (s *AtomicSwap) AcceptOffer(alicePubKey ed25519.PublicKey, now time.Time) (*RefundDetails, error)

func (*AtomicSwap) AnnounceDeposit

func (s *AtomicSwap) AnnounceDeposit() error

func (*AtomicSwap) Check

func (s *AtomicSwap) Check(now time.Time) (noLongerNeeded bool, maybeRefundTxID *types.TransactionID, err error)

func (*AtomicSwap) EnableFunding

func (s *AtomicSwap) EnableFunding(aliceRefundNoncePoint ed25519.CurvePoint, refundSigAlice []byte) (*types.TransactionID, error)

func (*AtomicSwap) EncodedRefundTransaction

func (s *AtomicSwap) EncodedRefundTransaction() (string, bool)

func (*AtomicSwap) RequestAdaptorDetails

func (s *AtomicSwap) RequestAdaptorDetails(aliceClaimUnlockHash types.UnlockHash,
	aliceClaimNoncePoint ed25519.CurvePoint) (*AdaptorDetails, error)

func (*AtomicSwap) RequestBindingOffer

func (s *AtomicSwap) RequestBindingOffer(antiSpamID big.Int, now time.Time) (*trader.Offer, error)

func (*AtomicSwap) RequestNonBindingOffer

func (s *AtomicSwap) RequestNonBindingOffer(siacoin types.Currency, now time.Time) (*trader.Offer, error)

func (*AtomicSwap) StateText

func (s *AtomicSwap) StateText() string

type Blacklist

type Blacklist struct {
	// contains filtered or unexported fields
}

func NewBlacklist

func NewBlacklist() Blacklist

type RefundDetails

type RefundDetails struct {
	BobPubKey           ed25519.PublicKey
	FundingOutputID     types.SiacoinOutputID
	BobRefundUnlockHash types.UnlockHash
	Timelock            types.BlockHeight
	BobRefundNoncePoint ed25519.CurvePoint
}

Jump to

Keyboard shortcuts

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