Lazzeruz 9b722b8669 More changes yay
Renamed a bunch of stuff to the right Github. Hope it works.
2023-12-09 21:18:29 +01:00

32 lines
742 B
Go

package server
import (
"context"
"github.com/zoomy-network/zoomyd/cmd/zoomywallet/daemon/pb"
)
func (s *server) Send(_ context.Context, request *pb.SendRequest) (*pb.SendResponse, error) {
s.lock.Lock()
defer s.lock.Unlock()
unsignedTransactions, err := s.createUnsignedTransactions(request.ToAddress, request.Amount, request.IsSendAll,
request.From, request.UseExistingChangeAddress)
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, SignedTransactions: signedTransactions}, nil
}