wallet

package
v0.0.0-...-8768773 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Wallet

type Wallet struct {
	Address    Address
	PrivateKey *ecdsa.PrivateKey
}

Wallet holds both the address and the private key of an ethereum account

func NewWallet

func NewWallet() *Wallet

NewWallet returns a new wallet object corresponding to a random private key

func NewWalletFromPrivateKey

func NewWalletFromPrivateKey(key string) *Wallet

NewWalletFromPrivateKey returns a new wallet object corresponding to a given private key

func (*Wallet) GetAddress

func (w *Wallet) GetAddress() string

GetAddress returns the wallet address

func (*Wallet) GetPrivateKey

func (w *Wallet) GetPrivateKey() string

GetPrivateKey returns the wallet private key

func (*Wallet) NewOrder

func (w *Wallet) NewOrder(id, amountBuy, amountSell int64, p TokenPair, ot OrderType) (*Order, error)

NewOrder (DEPRECATED - use the order factory instead) creates a new order from a wallet, compute the order hash and signs it with the wallet private key

func (*Wallet) NewTrade

func (w *Wallet) NewTrade(o *Order, amount int64) (*Trade, error)

NewTrade (DEPRECATED - use the order factory instead) creates a new trade from a wallet and a given order, compute the trade hash and signs it with the wallet private key

func (*Wallet) SignHash

func (w *Wallet) SignHash(h Hash) (*Signature, error)

SignHash signs a hashed message with a wallet private key and returns it as a Signature object

func (*Wallet) SignTrade

func (w *Wallet) SignTrade(t *Trade) error

SignTrade signs and sets the signature of a trade with a wallet private key

Jump to

Keyboard shortcuts

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