Skip to content

Commit c296650

Browse files
committed
cmd/commands: add offset and limit params to roots cmd
Without these parameters only the first 512 asset roots can be shown.
1 parent 28c4ea8 commit c296650

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

cmd/commands/universe.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,22 @@ var universeRootsCommand = cli.Command{
117117
cli.BoolFlag{
118118
Name: skipAmountsByIdName,
119119
Usage: "skip showing the amounts by ID for grouped " +
120-
"assets to optimize response size and speed",
120+
"assets to optimize response size and speed; " +
121+
"only applies if no asset ID or group key is " +
122+
"specified",
123+
},
124+
cli.Uint64Flag{
125+
Name: offsetName,
126+
Usage: "the offset to start returning results from; " +
127+
"only applies if no asset ID or group key is " +
128+
"specified",
129+
},
130+
cli.Uint64Flag{
131+
Name: limitName,
132+
Usage: "the maximum number of results to return; " +
133+
"only applies if no asset ID or group key is " +
134+
"specified",
135+
Value: universe.RequestPageSize,
121136
},
122137
},
123138
Action: universeRoots,
@@ -205,6 +220,8 @@ func universeRoots(ctx *cli.Context) error {
205220
universeRoots, err := client.AssetRoots(
206221
ctxc, &unirpc.AssetRootRequest{
207222
WithAmountsById: !ctx.Bool(skipAmountsByIdName),
223+
Offset: int32(ctx.Uint64(offsetName)),
224+
Limit: int32(ctx.Uint64(limitName)),
208225
},
209226
)
210227
if err != nil {

0 commit comments

Comments
 (0)