mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-24 07:46:45 +00:00

* Added option to choose from address in kaspawallet + fixed a bug with 0 change * Checking if From is missing * Fixed after merge to kaspad0.12 * Applying changes also to send command * Better help description * Fixed bug where we take all utxos except the one we wanted * Swallow the parsing error only when we want to filter * checking for wallet address directly * go fmt * Changing to `--from-address` Co-authored-by: Ori Newman <orinewman1@gmail.com>
26 lines
601 B
Go
26 lines
601 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, request.From)
|
|
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
|
|
}
|