func (t *Trade) Decode(trade map[string]interface{}) error {
	if trade["orderHash"] == nil {
		return errors.New("Order Hash is not set")
	}
	t.OrderHash = HexToHash(trade["orderHash"].(string))

	if trade["pairID"] == nil {
		return errors.New("Pair ID is not set")
	}
	t.PairID = HexToHash(trade["pairID"].(string))

	t.Amount = new(big.Int)
	t.Amount.UnmarshalJSON([]byte(trade["amount"].(string)))
	t.TradeNonce = new(big.Int)
	t.TradeNonce.UnmarshalJSON([]byte(trade["amount"].(string)))
	t.Taker = HexToAddress(trade["taker"].(string))
	t.Taker.UnmarshalJSON([]byte(trade["taker"].(string)))

	signature := trade["signature"].(map[string]interface{})
	t.Signature = &Signature{
		V: byte(signature["V"].(float64)),
		R: HexToHash(signature["R"].(string)),
		S: HexToHash(signature["S"].(string)),
	}

	t.Hash = HexToHash(trade["hash"].(string))
	return nil
}
// DecodeTrade takes a payload previously unmarshalled from a JSON byte string
// and decodes it into an Trade object
DecodeTrade takes a payload previously unmarshalled from a JSON byte string
and decodes it into an Trade object
// DecodeTrade takes a payload previously unmarshalled from a JSON byte string // and decodes it into an Trade object
func (t *Trade) Decode(trade map[string]interface{}) error {
	if trade["orderHash"] == nil {
		return errors.New("Order Hash is not set")
	}
	t.OrderHash = HexToHash(trade["orderHash"].(string))
	if trade["pairID"] == nil {
		return errors.New("Pair ID is not set")
	}
	t.PairID = HexToHash(trade["pairID"].(string))
	t.Amount = new(big.Int)
	t.Amount.UnmarshalJSON([]byte(trade["amount"].(string)))
	t.TradeNonce = new(big.Int)
	t.TradeNonce.UnmarshalJSON([]byte(trade["amount"].(string)))
	t.Taker = HexToAddress(trade["taker"].(string))
	t.Taker.UnmarshalJSON([]byte(trade["taker"].(string)))
	signature := trade["signature"].(map[string]interface{})
	t.Signature = &Signature{
		V: byte(signature["V"].(float64)),
		R: HexToHash(signature["R"].(string)),
		S: HexToHash(signature["S"].(string)),
	}
	t.Hash = HexToHash(trade["hash"].(string))
	return nil
}
func ( t * Trade ) Decode ( trade map [ string ] interface { } ) error { if trade [ " " ] == nil { return errors . New ( " " ) } t . OrderHash = HexToHash ( trade [ " " ] . ( string ) ) if trade [ " " ] == nil { return errors . New ( " " ) } t . PairID = HexToHash ( trade [ " " ] . ( string ) ) t . Amount = new ( big . Int ) t . Amount . UnmarshalJSON ( [ ] byte ( trade [ " " ] . ( string ) ) ) t . TradeNonce = new ( big . Int ) t . TradeNonce . UnmarshalJSON ( [ ] byte ( trade [ " " ] . ( string ) ) ) t . Taker = HexToAddress ( trade [ " " ] . ( string ) ) t . Taker . UnmarshalJSON ( [ ] byte ( trade [ " " ] . ( string ) ) ) signature := trade [ " " ] . ( map [ string ] interface { } ) t . Signature = & Signature { V : byte ( signature [ " " ] . ( float64 ) ) , R : HexToHash ( signature [ " " ] . ( string ) ) , S : HexToHash ( signature [ " " ] . ( string ) ) , } t . Hash = HexToHash ( trade [ " " ] . ( string ) ) return nil }
DecodeTrade takes a payload previously unmarshalled from a JSON byte string
and decodes it into an Trade object
DecodeTrade takes a payload previously unmarshalled from a JSON byte string and decodes it into an Trade object