Documentation ¶
Index ¶
- Variables
- type AdaptorDetails
- type AtomicSwap
- func (s *AtomicSwap) AcceptOffer(alicePubKey ed25519.PublicKey, now time.Time) (*RefundDetails, error)
- func (s *AtomicSwap) AnnounceDeposit() error
- func (s *AtomicSwap) Check(now time.Time) (noLongerNeeded bool, maybeRefundTxID *types.TransactionID, err error)
- func (s *AtomicSwap) EnableFunding(aliceRefundNoncePoint ed25519.CurvePoint, refundSigAlice []byte) (*types.TransactionID, error)
- func (s *AtomicSwap) EncodedRefundTransaction() (string, bool)
- func (s *AtomicSwap) RequestAdaptorDetails(aliceClaimUnlockHash types.UnlockHash, aliceClaimNoncePoint ed25519.CurvePoint) (*AdaptorDetails, error)
- func (s *AtomicSwap) RequestBindingOffer(antiSpamID big.Int, now time.Time) (*trader.Offer, error)
- func (s *AtomicSwap) RequestNonBindingOffer(siacoin types.Currency, now time.Time) (*trader.Offer, error)
- func (s *AtomicSwap) StateText() string
- type Blacklist
- type RefundDetails
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 ¶
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 (*AtomicSwap) RequestNonBindingOffer ¶
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 }
Click to show internal directories.
Click to hide internal directories.