binder

package
v0.0.0-...-a5eb945 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2018 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binder

type Binder struct {
	*bindings.AtomicInfo
	*bindings.Orderbook
	*bindings.RenExSettlement
	*bindings.AtomicSwap
	// contains filtered or unexported fields
}

Binder implements all methods that will communicate with the smart contracts

func NewBinder

func NewBinder(privKey *ecdsa.PrivateKey, conn ethclient.Conn) (Binder, error)

NewBinder returns a Binder to communicate with contracts

func (*Binder) AuditAtomicSwap

func (binder *Binder) AuditAtomicSwap(swapID [32]byte) ([32]byte, []byte, *big.Int, int64, error)

AuditAtomicSwap Audits an Atomic swap

func (*Binder) AuditSecretAtomicSwap

func (binder *Binder) AuditSecretAtomicSwap(swapID [32]byte) ([32]byte, error)

AuditSecretAtomicSwap audits the secret of an Atom swap

func (*Binder) AuthorizeAtomBox

func (binder *Binder) AuthorizeAtomBox() error

AuthorizeAtomBox authorizes the atom box to submit the swap details

func (*Binder) CheckForMatch

func (binder *Binder) CheckForMatch(orderID order.ID, wait bool) (match.Match, error)

CheckForMatch checks if a match is found and returns the match object. If a match is not found and the 'wait' flag is set to true, it loops until a match is found.

func (*Binder) InfoTimeStamp

func (binder *Binder) InfoTimeStamp(orderID order.ID) (int64, error)

InfoTimeStamp returns the time at which the address for the atomic swap is submitted.

func (*Binder) InitiateAtomicSwap

func (binder *Binder) InitiateAtomicSwap(swapID swap.ID, to []byte, hash [32]byte, value *big.Int, expiry int64) error

InitiateAtomicSwap initiates a new Ethereum Atomic swap

func (*Binder) InitiateTimeStamp

func (binder *Binder) InitiateTimeStamp(orderID order.ID) (int64, error)

InitiateTimeStamp returns the time at which the atomic swap is initiated.

func (*Binder) OrderTraderAddress

func (binder *Binder) OrderTraderAddress(orderID [32]byte) ([]byte, error)

OrderTraderAddress returns the order's submitting trader's ethereum address.

func (*Binder) ReceiveOwnerAddress

func (binder *Binder) ReceiveOwnerAddress(orderID order.ID, waitTill int64) ([]byte, error)

ReceiveOwnerAddress receives the owner address for atomic swap

func (*Binder) ReceiveSwapDetails

func (binder *Binder) ReceiveSwapDetails(orderID order.ID, waitTill int64) ([]byte, error)

ReceiveSwapDetails receives the swap details from the ethereum blockchain

func (*Binder) RedeemAtomicSwap

func (binder *Binder) RedeemAtomicSwap(swapID [32]byte, secret [32]byte) error

RedeemAtomicSwap initiates a new Ethereum Atomic swap

func (*Binder) RedeemTimeStamp

func (binder *Binder) RedeemTimeStamp(orderID swap.ID) (int64, error)

RedeemTimeStamp returns the time at which the atomic swap is redeemed.

func (*Binder) RefundAtomicSwap

func (binder *Binder) RefundAtomicSwap(swapID [32]byte) error

RefundAtomicSwap refunds an Ethereum Atomic swap

func (*Binder) SendOwnerAddress

func (binder *Binder) SendOwnerAddress(orderID order.ID, address []byte) error

SendOwnerAddress set's the owner address for atomic swap

func (*Binder) SendSwapDetails

func (binder *Binder) SendSwapDetails(orderID order.ID, swapDetails []byte) error

SendSwapDetails stores the swap details on the ethereum blockchain

func (*Binder) SlashBond

func (binder *Binder) SlashBond(guiltyOrderID order.ID) error

SlashBond receives the guilty trader's atomic swap order id and slashes their bond

func (*Binder) SubmitBuyOrder

func (binder *Binder) SubmitBuyOrder(orderID [32]byte) error

SubmitBuyOrder submits a new buy order

func (*Binder) SubmitSellOrder

func (binder *Binder) SubmitSellOrder(orderID [32]byte) error

SubmitSellOrder submits a new sell order

Jump to

Keyboard shortcuts

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