func (cl *BenchClient) WithdrawLightning(amount uint64, asset match.Asset) (withdrawReply *cxrpc.WithdrawReply, err error) {

	if cl.PrivKey == nil {
		err = fmt.Errorf("Private key nonexistent, set or specify private key so the client can sign commands")
		return
	}

	withdrawReply = new(cxrpc.WithdrawReply)
	withdrawArgs := &cxrpc.WithdrawArgs{
		Withdrawal: &match.Withdrawal{
			Amount:    amount,
			Asset:     asset,
			Lightning: true,
		},
	}

	// create e = hash(m)
	sha3 := sha3.New256()
	sha3.Write(withdrawArgs.Withdrawal.Serialize())
	e := sha3.Sum(nil)

	// Sign order
	compactSig, err := koblitz.SignCompact(koblitz.S256(), cl.PrivKey, e, false)

	// set signature in args
	withdrawArgs.Signature = compactSig

	if err = cl.Call("OpencxRPC.Withdraw", withdrawArgs, withdrawReply); err != nil {
		return
	}

	if withdrawReply.Txid == "" {
		err = fmt.Errorf("Error: Unsupported Asset")
		return
	}

	return
}
// WithdrawLightning calls the withdraw rpc command, but with the lightning boolean set to true
WithdrawLightning calls the withdraw rpc command, but with the lightning boolean set to true
// WithdrawLightning calls the withdraw rpc command but with the lightning boolean set to true
func (cl *BenchClient) WithdrawLightning(amount uint64, asset match.Asset) (withdrawReply *cxrpc.WithdrawReply, err error) {
	if cl.PrivKey == nil {
		err = fmt.Errorf("Private key nonexistent, set or specify private key so the client can sign commands")
		return
	}
	withdrawReply = new(cxrpc.WithdrawReply)
	withdrawArgs := &cxrpc.WithdrawArgs{
		Withdrawal: &match.Withdrawal{
			Amount:    amount,
			Asset:     asset,
			Lightning: true,
		},
	}
	sha3 := sha3.New256()
	sha3.Write(withdrawArgs.Withdrawal.Serialize())
	e := sha3.Sum(nil)
	compactSig, err := koblitz.SignCompact(koblitz.S256(), cl.PrivKey, e, false)
	withdrawArgs.Signature = compactSig
	if err = cl.Call("OpencxRPC.Withdraw", withdrawArgs, withdrawReply); err != nil {
		return
	}
	if withdrawReply.Txid == "" {
		err = fmt.Errorf("Error: Unsupported Asset")
		return
	}
	return
}
func ( cl * BenchClient ) WithdrawLightning ( amount uint64 , asset match . Asset ) ( withdrawReply * cxrpc . WithdrawReply , err error ) { if cl . PrivKey == nil { err = fmt . Errorf ( " " ) return } withdrawReply = new ( cxrpc . WithdrawReply ) withdrawArgs := & cxrpc . WithdrawArgs { Withdrawal : & match . Withdrawal { Amount : amount , Asset : asset , Lightning : true , } , } sha3 := sha3 . New256 ( ) sha3 . Write ( withdrawArgs . Withdrawal . Serialize ( ) ) e := sha3 . Sum ( nil ) compactSig , err := koblitz . SignCompact ( koblitz . S256 ( ) , cl . PrivKey , e , false ) withdrawArgs . Signature = compactSig if err = cl . Call ( " " , withdrawArgs , withdrawReply ) ; err != nil { return } if withdrawReply . Txid == " " { err = fmt . Errorf ( " " ) return } return }
WithdrawLightning calls the withdraw rpc command, but with the lightning boolean set to true
WithdrawLightning calls the withdraw rpc command but with the lightning boolean set to true
// create e = hash(m) // Sign order // set signature in args