@@ -158,6 +158,8 @@ const (
158
158
limitName = "limit"
159
159
160
160
offsetName = "offset"
161
+
162
+ directionName = "direction"
161
163
)
162
164
163
165
var queryAddrsCommand = cli.Command {
@@ -293,6 +295,20 @@ var receivesAddrCommand = cli.Command{
293
295
Usage : "filter transfers created before this + " +
294
296
"unix timestamp (seconds)" ,
295
297
},
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 desc." ,
310
+ Value : "desc" ,
311
+ },
296
312
},
297
313
Action : addrReceives ,
298
314
}
@@ -311,10 +327,18 @@ func addrReceives(ctx *cli.Context) error {
311
327
addr = ctx .Args ().First ()
312
328
}
313
329
330
+ direction := taprpc .SortDirection_SORT_DIRECTION_DESC
331
+ if ctx .String (directionName ) == "asc" {
332
+ direction = taprpc .SortDirection_SORT_DIRECTION_ASC
333
+ }
334
+
314
335
resp , err := client .AddrReceives (ctxc , & taprpc.AddrReceivesRequest {
315
336
FilterAddr : addr ,
316
337
StartTimestamp : ctx .Uint64 ("start_timestamp" ),
317
338
EndTimestamp : ctx .Uint64 ("end_timestamp" ),
339
+ Limit : int32 (ctx .Int64 (limitName )),
340
+ Offset : int32 (ctx .Int64 (offsetName )),
341
+ Direction : direction ,
318
342
})
319
343
if err != nil {
320
344
return fmt .Errorf ("unable to query addr receives: %w" , err )
0 commit comments