// NewIncorrectCltvExpiry creates new instance of the FailIncorrectCltvExpiry.
542190
func NewIncorrectCltvExpiry(cltvExpiry uint32,
	update ChannelUpdate) *FailIncorrectCltvExpiry {

	return &FailIncorrectCltvExpiry{
		CltvExpiry: cltvExpiry,
		Update:     update,
	}
}
943985
func NewDefaultCciForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Cci, err error) {
	ind, err := NewDefaultCciWithSrcLen(sourceLength)
	priceStream.AddTickSubscription(ind)
	return ind, err
}
358110
func NewClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec {
	return &clientCodec{
		dec:     json.NewDecoder(conn),
		enc:     json.NewEncoder(conn),
		c:       conn,
		pending: make(map[uint64]string),
	}
}
1230975
func NewDefaultLlvForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Llv, err error) {
	ind, err := NewDefaultLlv()
	priceStream.AddTickSubscription(ind)
	return ind, err
}
639917
func parseMinFinalCLTVExpiry(data []byte) (*uint64, error) {
	expiry, err := base32ToUint64(data)
	if err != nil {
		return nil, err
	}

	return &expiry, nil
}
551884
func NewDefaultMinusDiForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *MinusDi, err error) {
	ind, err := NewDefaultMinusDiWithSrcLen(sourceLength)
	priceStream.AddTickSubscription(ind)
	return ind, err
}
233749
func (s *PasswordPolicy) SetHardExpiry(v bool) *PasswordPolicy {
	s.HardExpiry = &v
	return s
}
483416
func NewFailureCounter(FailedThreshold int32, WorkerThresholdTimeWindow time.Duration) *FailureCounter {
	counter := &FailureCounter{
		failedThreshold: FailedThreshold,
		stop:            make(chan bool),
	}
	go func() {
		for {
			timeout := time.NewTimer(WorkerThresholdTimeWindow)
			select {
			case <-timeout.C:
				{
					if counter.count >= FailedThreshold {
						counter.failed = true
						return
					} else {
						inLock(&counter.countLock, func() {
							counter.count = 0
						})
					}
				}
			case <-counter.stop:
				timeout.Stop()
				return
			}
		}
	}()
	return counter
}
409889
func NewConsumerCodec(f func(io.ReadWriteCloser) rpc.ClientCodec) *rpc.Client {
	return rpc.NewClientWithCodec(f(rwCloser{os.Stdin, os.Stdout}))
}
1159481
func NewEtcdSafePointKV(addrs []string, tlsConfig *tls.Config) (*EtcdSafePointKV, error) {
	etcdCli, err := createEtcdKV(addrs, tlsConfig)
	if err != nil {
		return nil, errors.Trace(err)
	}
	return &EtcdSafePointKV{cli: etcdCli}, nil
}
856762
func NewWithCustomTimeout(apiKey, apiSecret string, timeout time.Duration) *Bittrex {
	client := NewClientWithCustomTimeout(apiKey, apiSecret, timeout)
	return &Bittrex{client}
}
923037
func NewLlvForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Llv, err error) {
	ind, err := NewLlv(timePeriod, selectData)
	priceStream.AddTickSubscription(ind)
	return ind, err
}
879284
func NewObvForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Obv, err error) {
	ind, err := NewObvWithSrcLen(sourceLength)
	priceStream.AddTickSubscription(ind)
	return ind, err
}
623277
func NewDefaultLlvBarsForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *LlvBars, err error) {
	ind, err := NewDefaultLlvBarsWithSrcLen(sourceLength)
	priceStream.AddTickSubscription(ind)
	return ind, err
}
487351
func NewCciForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *Cci, err error) {
	ind, err := NewCciWithSrcLen(sourceLength, timePeriod)
	priceStream.AddTickSubscription(ind)
	return ind, err
}
507646
func NewClientCodec(conn io.ReadWriteCloser) core.ClientCodec {
	return NewCodec(true, true, conn)
}
383374
func NewRcChannelsRaw(TIME_BOOT_MS uint32, CHAN1_RAW uint16, CHAN2_RAW uint16, CHAN3_RAW uint16, CHAN4_RAW uint16, CHAN5_RAW uint16, CHAN6_RAW uint16, CHAN7_RAW uint16, CHAN8_RAW uint16, PORT uint8, RSSI uint8) *RcChannelsRaw {
	m := RcChannelsRaw{}
	m.TIME_BOOT_MS = TIME_BOOT_MS
	m.CHAN1_RAW = CHAN1_RAW
	m.CHAN2_RAW = CHAN2_RAW
	m.CHAN3_RAW = CHAN3_RAW
	m.CHAN4_RAW = CHAN4_RAW
	m.CHAN5_RAW = CHAN5_RAW
	m.CHAN6_RAW = CHAN6_RAW
	m.CHAN7_RAW = CHAN7_RAW
	m.CHAN8_RAW = CHAN8_RAW
	m.PORT = PORT
	m.RSSI = RSSI
	return &m
}