eth

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEthereumAtom

func NewEthereumAtom(adapter Adapter, client ethclient.Conn, key keystore.Key, orderID [32]byte) (swap.Atom, error)

NewEthereumAtom returns a new Ethereum RequestAtom instance

Types

type Adapter

type Adapter interface {
	ReceiveSwapDetails(order.ID, int64) ([]byte, error)
}

type EthereumAtom

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

func (*EthereumAtom) Audit

func (atom *EthereumAtom) Audit() ([32]byte, []byte, *big.Int, int64, error)

Audit an Atom swap by calling a function on ethereum

func (*EthereumAtom) AuditSecret

func (atom *EthereumAtom) AuditSecret() ([32]byte, error)

AuditSecret audits the secret of an Atom swap by calling a function on ethereum

func (*EthereumAtom) Deserialize

func (atom *EthereumAtom) Deserialize(data []byte) error

Deserialize deserializes the atom details

func (*EthereumAtom) GetFromAddress

func (atom *EthereumAtom) GetFromAddress() ([]byte, error)

GetFromAddress returns the address of the sender

func (*EthereumAtom) Initiate

func (atom *EthereumAtom) Initiate(to []byte, hash [32]byte, value *big.Int, expiry int64) error

Initiate a new Atom swap by calling a function on ethereum

func (*EthereumAtom) PriorityCode

func (atom *EthereumAtom) PriorityCode() uint32

PriorityCode returns the priority code of the currency.

func (*EthereumAtom) Redeem

func (atom *EthereumAtom) Redeem(secret [32]byte) error

Redeem an Atom swap by calling a function on ethereum

func (*EthereumAtom) RedeemedAt

func (atom *EthereumAtom) RedeemedAt() (int64, error)

RedeemedAt returns the timestamp at which the atom is redeemed

func (*EthereumAtom) Refund

func (atom *EthereumAtom) Refund() error

Refund an Atom swap by calling a function on ethereum

func (*EthereumAtom) Serialize

func (atom *EthereumAtom) Serialize() ([]byte, error)

Serialize serializes the atom details

func (*EthereumAtom) WaitForCounterRedemption

func (atom *EthereumAtom) WaitForCounterRedemption() error

WaitForCounterRedemption waits for the counter-party to initiate.

type EthereumData

type EthereumData struct {
	SwapID   [32]byte `json:"swap_id"`
	HashLock [32]byte `json:"hash_lock"`
}

EthereumData

Jump to

Keyboard shortcuts

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