Documentation ¶
Index ¶
- type Wallet
- func (w *Wallet) GetAddress() string
- func (w *Wallet) GetPrivateKey() string
- func (w *Wallet) NewOrder(id, amountBuy, amountSell int64, p TokenPair, ot OrderType) (*Order, error)
- func (w *Wallet) NewTrade(o *Order, amount int64) (*Trade, error)
- func (w *Wallet) SignHash(h Hash) (*Signature, error)
- func (w *Wallet) SignTrade(t *Trade) error
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 ¶
NewWalletFromPrivateKey returns a new wallet object corresponding to a given private key
func (*Wallet) GetAddress ¶
GetAddress returns the wallet address
func (*Wallet) GetPrivateKey ¶
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 ¶
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