github.com/decred/dcrlnd@v0.7.6/cmd/dcrlncli/walletrpc_types.go (about) 1 package main 2 3 import "github.com/decred/dcrlnd/lnrpc/walletrpc" 4 5 // PendingSweep is a CLI-friendly type of the walletrpc.PendingSweep proto. We 6 // use this to show more useful string versions of byte slices and enums. 7 type PendingSweep struct { 8 OutPoint OutPoint `json:"outpoint"` 9 WitnessType string `json:"witness_type"` 10 AmountAtoms uint32 `json:"amount_atoms"` 11 AtomsPerByte uint32 `json:"atoms_per_byte"` 12 BroadcastAttempts uint32 `json:"broadcast_attempts"` 13 NextBroadcastHeight uint32 `json:"next_broadcast_height"` 14 RequestedAtomsPerByte uint32 `json:"requested_atoms_per_byte"` 15 RequestedConfTarget uint32 `json:"requested_conf_target"` 16 Force bool `json:"force"` 17 } 18 19 // NewPendingSweepFromProto converts the walletrpc.PendingSweep proto type into 20 // its corresponding CLI-friendly type. 21 func NewPendingSweepFromProto(pendingSweep *walletrpc.PendingSweep) *PendingSweep { 22 return &PendingSweep{ 23 OutPoint: NewOutPointFromProto(pendingSweep.Outpoint), 24 WitnessType: pendingSweep.WitnessType.String(), 25 AmountAtoms: pendingSweep.AmountAtoms, 26 AtomsPerByte: pendingSweep.AtomsPerByte, 27 BroadcastAttempts: pendingSweep.BroadcastAttempts, 28 NextBroadcastHeight: pendingSweep.NextBroadcastHeight, 29 RequestedAtomsPerByte: pendingSweep.RequestedAtomsPerByte, 30 RequestedConfTarget: pendingSweep.RequestedConfTarget, 31 Force: pendingSweep.Force, 32 } 33 }