From 116143fc3d083b167a251ae8832cad9d6efaa364 Mon Sep 17 00:00:00 2001 From: Marko Kungla Date: Sat, 30 Mar 2024 12:51:11 +0200 Subject: [PATCH] sfix: update pool_relays cmd --- internal/api/pool.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/internal/api/pool.go b/internal/api/pool.go index 0382628..e58521c 100644 --- a/internal/api/pool.go +++ b/internal/api/pool.go @@ -364,6 +364,33 @@ func cmdPoolPoolRetirements(c *client) *happy.Command { } func cmdPoolPoolRelays(c *client) *happy.Command { + cmd := happy.NewCommand("pool_relays", + happy.Option("description", "Pool Relays"), + happy.Option("category", categoryPool), + ).WithFlags(pagingFlags...) + + cmd.AddInfo("A list of registered relays for all pools") + + cmd.AddInfo(` + Docs: https://api.koios.rest/#get-/pool_relays + + Example: koios-cli api pool_relays + `) + + cmd.Do(func(sess *happy.Session, args happy.Args) error { + opts, err := c.newRequestOpts(sess, args) + if err != nil { + return err + } + + res, err := c.koios().GetPoolRelays(sess, opts) + + apiOutput(c.noFormat, res, err) + return err + }) + + return cmd + return notimplCmd(categoryPool, "pool_relays") }