|
|
@ -39,14 +39,14 @@ func newStaticAddress(ctx *cli.Context) error {
|
|
|
|
return cli.ShowCommandHelp(ctx, "new")
|
|
|
|
return cli.ShowCommandHelp(ctx, "new")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
client, cleanup, err := getAddressClient(ctx)
|
|
|
|
client, cleanup, err := getClient(ctx)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
defer cleanup()
|
|
|
|
defer cleanup()
|
|
|
|
|
|
|
|
|
|
|
|
resp, err := client.NewAddress(
|
|
|
|
resp, err := client.NewStaticAddress(
|
|
|
|
ctxb, &looprpc.NewAddressRequest{},
|
|
|
|
ctxb, &looprpc.NewStaticAddressRequest{},
|
|
|
|
)
|
|
|
|
)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
@ -86,13 +86,14 @@ func listUnspent(ctx *cli.Context) error {
|
|
|
|
return cli.ShowCommandHelp(ctx, "listunspent")
|
|
|
|
return cli.ShowCommandHelp(ctx, "listunspent")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
client, cleanup, err := getAddressClient(ctx)
|
|
|
|
client, cleanup, err := getClient(ctx)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
defer cleanup()
|
|
|
|
defer cleanup()
|
|
|
|
|
|
|
|
|
|
|
|
resp, err := client.ListUnspent(ctxb, &looprpc.ListUnspentRequest{
|
|
|
|
resp, err := client.ListUnspentDeposits(
|
|
|
|
|
|
|
|
ctxb, &looprpc.ListUnspentDepositsRequest{
|
|
|
|
MinConfs: int32(ctx.Int("min_confs")),
|
|
|
|
MinConfs: int32(ctx.Int("min_confs")),
|
|
|
|
MaxConfs: int32(ctx.Int("max_confs")),
|
|
|
|
MaxConfs: int32(ctx.Int("max_confs")),
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -104,21 +105,3 @@ func listUnspent(ctx *cli.Context) error {
|
|
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func getAddressClient(ctx *cli.Context) (looprpc.StaticAddressClientClient,
|
|
|
|
|
|
|
|
func(), error) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rpcServer := ctx.GlobalString("rpcserver")
|
|
|
|
|
|
|
|
tlsCertPath, macaroonPath, err := extractPathArgs(ctx)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return nil, nil, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
conn, err := getClientConn(rpcServer, tlsCertPath, macaroonPath)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return nil, nil, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
cleanup := func() { conn.Close() }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addressClient := looprpc.NewStaticAddressClientClient(conn)
|
|
|
|
|
|
|
|
return addressClient, cleanup, nil
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|