@@ -158,6 +158,8 @@ const (
158158 limitName = "limit"
159159
160160 offsetName = "offset"
161+
162+ directionName = "direction"
161163)
162164
163165var queryAddrsCommand = cli.Command {
@@ -293,6 +295,20 @@ var receivesAddrCommand = cli.Command{
293295 Usage : "filter transfers created before this + " +
294296 "unix timestamp (seconds)" ,
295297 },
298+ cli.Int64Flag {
299+ Name : limitName ,
300+ Usage : "the max number of events returned" ,
301+ },
302+ cli.Int64Flag {
303+ Name : offsetName ,
304+ Usage : "the number of events to skip" ,
305+ },
306+ cli.StringFlag {
307+ Name : directionName ,
308+ Usage : "the sort direction for events (asc or desc). " +
309+ "Defaults to asc." ,
310+ Value : "asc" ,
311+ },
296312 },
297313 Action : addrReceives ,
298314}
@@ -311,10 +327,18 @@ func addrReceives(ctx *cli.Context) error {
311327 addr = ctx .Args ().First ()
312328 }
313329
330+ direction := taprpc .SortDirection_SORT_DIRECTION_ASC
331+ if ctx .String (directionName ) == "desc" {
332+ direction = taprpc .SortDirection_SORT_DIRECTION_DESC
333+ }
334+
314335 resp , err := client .AddrReceives (ctxc , & taprpc.AddrReceivesRequest {
315336 FilterAddr : addr ,
316337 StartTimestamp : ctx .Uint64 ("start_timestamp" ),
317338 EndTimestamp : ctx .Uint64 ("end_timestamp" ),
339+ Limit : int32 (ctx .Int64 (limitName )),
340+ Offset : int32 (ctx .Int64 (offsetName )),
341+ Direction : direction ,
318342 })
319343 if err != nil {
320344 return fmt .Errorf ("unable to query addr receives: %w" , err )
0 commit comments