Skip to content

Commit

Permalink
fix: update pool_updates cmd
Browse files Browse the repository at this point in the history
Signed-off-by: Marko Kungla <[email protected]>
  • Loading branch information
mkungla committed Mar 30, 2024
1 parent 5f613b6 commit f9d660c
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion internal/api/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,35 @@ func cmdPoolPoolHistory(c *client) *happy.Command {
}

func cmdPoolPoolUpdates(c *client) *happy.Command {
return notimplCmd(categoryPool, "pool_updates")
cmd := happy.NewCommand("pool_updates",
happy.Option("description", "Pool Updates (History)"),
happy.Option("category", categoryPool),
happy.Option("argn.min", 1),
happy.Option("argn.max", 1),
happy.Option("usage", "koios api pool_updates [_pool_bech32]"),
).WithFlags(pagingFlags...)

cmd.AddInfo("Return all pool updates for all pools or only updates for specific pool if specified")

cmd.AddInfo(`
Docs: https://api.koios.rest/#get-/pool_updates
Example: koios-cli api pool_updates
Example: koios-cli api pool_updates pool155efqn9xpcf73pphkk88cmlkdwx4ulkg606tne970qswczg3asc
`)

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().GetPoolUpdates(sess, koios.PoolID(args.Arg(0).String()), opts)
apiOutput(c.noFormat, res, err)
return err
})

return cmd
}

func cmdPoolPoolRegistrations(c *client) *happy.Command {
Expand Down

0 comments on commit f9d660c

Please sign in to comment.