func (s *batchSigner) Sign(batch *Batch) (BatchSignature, error) {
	ourSigs := make(BatchSignature)
	for _, acctDiff := range batch.AccountDiffs {
		acct, err := s.getAccount(acctDiff.AccountKey)
		if err != nil {
			return nil, fmt.Errorf("account not found: %v", err)
		}
		acctOut, err := acct.Output()
		if err != nil {
			return nil, fmt.Errorf("could not get account output: "+
				"%v", err)
		}
		var acctKey [33]byte
		copy(acctKey[:], acct.TraderKey.PubKey.SerializeCompressed())
		inputIndex := -1
		for idx, in := range batch.BatchTX.TxIn {
			if in.PreviousOutPoint == acct.OutPoint {
				inputIndex = idx
			}
		}
		if inputIndex == -1 {
			return nil, fmt.Errorf("account input not found")
		}
		traderKeyTweak := poolscript.TraderKeyTweak(
			acct.BatchKey, acct.Secret, acct.TraderKey.PubKey,
		)
		witnessScript, err := poolscript.AccountWitnessScript(
			acct.Expiry, acct.TraderKey.PubKey, acct.AuctioneerKey,
			acct.BatchKey, acct.Secret,
		)
		if err != nil {
			return nil, err
		}
		signDesc := &lndclient.SignDescriptor{
			KeyDesc:       *acct.TraderKey,
			SingleTweak:   traderKeyTweak,
			WitnessScript: witnessScript,
			Output:        acctOut,
			HashType:      txscript.SigHashAll,
			InputIndex:    inputIndex,
		}
		sigs, err := s.signer.SignOutputRaw(
			context.Background(), batch.BatchTX,
			[]*lndclient.SignDescriptor{signDesc},
		)
		if err != nil {
			return nil, err
		}
		ourSigs[acctKey], err = btcec.ParseDERSignature(sigs[0], btcec.S256())
		if err != nil {
			return nil, err
		}
	}
	return ourSigs, nil
}
Sign returns the witness stack of all account inputs in a batch that
belong to the trader.

NOTE: This method is part of the BatchSigner interface.
package order
import (
	"context"
	"fmt"
	"github.com/btcsuite/btcd/btcec"
	"github.com/btcsuite/btcd/txscript"
	"github.com/lightninglabs/lndclient"
	"github.com/lightninglabs/pool/account"
	"github.com/lightninglabs/pool/poolscript"
)
type batchSigner struct {
	getAccount func(*btcec.PublicKey) (*account.Account, error)
	signer     lndclient.SignerClient
}