mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-23 15:26:42 +00:00

* Add "sweep" command to kaspawallet * minor linting & layout improvements. * contain code in "sweep" * update to sweep.go * formatting and bugs * clean up renaming of ExtractTransaction functions * Nicer formating of display * address reveiw. * one more sweeped -> swept * missed one reveiw comment. (extra mass). * remove redundant code from split function. Co-authored-by: Ori Newman <orinewman1@gmail.com>
26 lines
587 B
Go
26 lines
587 B
Go
package server
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/kaspanet/kaspad/cmd/kaspawallet/daemon/pb"
|
|
)
|
|
|
|
func (s *server) Send(_ context.Context, request *pb.SendRequest) (*pb.SendResponse, error) {
|
|
unsignedTransactions, err := s.createUnsignedTransactions(request.ToAddress, request.Amount)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
signedTransactions, err := s.signTransactions(unsignedTransactions, request.Password)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
txIDs, err := s.broadcast(signedTransactions, false)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &pb.SendResponse{TxIDs: txIDs}, nil
|
|
}
|