func (w *Wallet) NewTrade(o *Order, amount uint64) (*Trade, error) {
	trade := &Trade{}

	trade.OrderHash = o.Hash
	trade.Amount = big.NewInt(int64(amount))
	trade.TradeNonce = big.NewInt(0)
	trade.Taker = w.Address

	hash := trade.ComputeHash()
	trade.Hash = hash

	sig, err := w.SignHash(hash)
	if err != nil {
		return nil, err
	}

	trade.Signature = sig
	return trade, nil
}
// 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
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
// 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 (w *Wallet) NewTrade(o *Order, amount uint64) (*Trade, error) {
	trade := &Trade{}
	trade.OrderHash = o.Hash
	trade.Amount = big.NewInt(int64(amount))
	trade.TradeNonce = big.NewInt(0)
	trade.Taker = w.Address
	hash := trade.ComputeHash()
	trade.Hash = hash
	sig, err := w.SignHash(hash)
	if err != nil {
		return nil, err
	}
	trade.Signature = sig
	return trade, nil
}
func ( w * Wallet ) NewTrade ( o * Order , amount uint64 ) ( * Trade , error ) { trade := & Trade { } trade . OrderHash = o . Hash trade . Amount = big . NewInt ( int64 ( amount ) ) trade . TradeNonce = big . NewInt ( 0 ) trade . Taker = w . Address hash := trade . ComputeHash ( ) trade . Hash = hash sig , err := w . SignHash ( hash ) if err != nil { return nil , err } trade . Signature = sig return trade , nil }
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
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