Example #1
0
func Input(nodeAddr, pubkey, amtS, nonceS, addr string) ([]byte, error) {
	pub, addrBytes, amt, nonce, err := checkCommon(nodeAddr, pubkey, addr, amtS, nonceS)
	if err != nil {
		return nil, err
	}

	txInput := types.TxInput{
		Address:  addrBytes,
		Amount:   amt,
		Sequence: int(nonce),
		PubKey:   pub,
	}

	n, errPtr := new(int64), new(error)
	buf := new(bytes.Buffer)
	txInput.WriteSignBytes(buf, n, errPtr)
	if *errPtr != nil {
		return nil, *errPtr
	}
	return buf.Bytes(), nil
}