func NewOrderFactory(p *TokenPair, w *Wallet) *OrderFactory {

	rpcClient, err := rpc.DialWebsocket(context.Background(), "ws://127.0.0.1:8546", "")
	if err != nil {
		log.Printf("Could not create order factory")
		return nil
	}

	client := ethclient.NewClient(rpcClient)

	params := &OrderParams{
		FeeMake: big.NewInt(0),
		FeeTake: big.NewInt(0),
		Nonce:   big.NewInt(0),
		Expires: big.NewInt(1e18),
	}

	source := rand.NewSource(time.Now().UnixNano())
	ng := rand.New(source)

	return &OrderFactory{
		Pair:           p,
		Wallet:         w,
		Exchange:       config.Exchange,
		Params:         params,
		CurrentOrderID: 0,
		Client:         client,
		NonceGenerator: ng,
	}
}
// NewOrderFactory returns an order factory from a given token pair and a given wallet
NewOrderFactory returns an order factory from a given token pair and a given wallet
// NewOrderFactory returns an order factory from a given token pair and a given wallet
func NewOrderFactory(p *TokenPair, w *Wallet) *OrderFactory {
	rpcClient, err := rpc.DialWebsocket(context.Background(), "ws://127.0.0.1:8546", "")
	if err != nil {
		log.Printf("Could not create order factory")
		return nil
	}
	client := ethclient.NewClient(rpcClient)
	params := &OrderParams{
		FeeMake: big.NewInt(0),
		FeeTake: big.NewInt(0),
		Nonce:   big.NewInt(0),
		Expires: big.NewInt(1e18),
	}
	source := rand.NewSource(time.Now().UnixNano())
	ng := rand.New(source)
	return &OrderFactory{
		Pair:           p,
		Wallet:         w,
		Exchange:       config.Exchange,
		Params:         params,
		CurrentOrderID: 0,
		Client:         client,
		NonceGenerator: ng,
	}
}
func NewOrderFactory ( p * TokenPair , w * Wallet ) * OrderFactory { rpcClient , err := rpc . DialWebsocket ( context . Background ( ) , " " , " " ) if err != nil { log . Printf ( " " ) return nil } client := ethclient . NewClient ( rpcClient ) params := & OrderParams { FeeMake : big . NewInt ( 0 ) , FeeTake : big . NewInt ( 0 ) , Nonce : big . NewInt ( 0 ) , Expires : big . NewInt ( 1e18 ) , } source := rand . NewSource ( time . Now ( ) . UnixNano ( ) ) ng := rand . New ( source ) return & OrderFactory { Pair : p , Wallet : w , Exchange : config . Exchange , Params : params , CurrentOrderID : 0 , Client : client , NonceGenerator : ng , } }
NewOrderFactory returns an order factory from a given token pair and a given wallet
NewOrderFactory returns an order factory from a given token pair and a given wallet