File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -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 {
@@ -283,6 +285,20 @@ var receivesAddrCommand = cli.Command{
283
285
Name : addrName ,
284
286
Usage : "show transfers of a single address only" ,
285
287
},
288
+ cli.Int64Flag {
289
+ Name : limitName ,
290
+ Usage : "the max number of events returned" ,
291
+ },
292
+ cli.Int64Flag {
293
+ Name : offsetName ,
294
+ Usage : "the number of events to skip" ,
295
+ },
296
+ cli.StringFlag {
297
+ Name : directionName ,
298
+ Usage : "the sort direction for events (asc or desc). " +
299
+ "Defaults to desc." ,
300
+ Value : "desc" ,
301
+ },
286
302
},
287
303
Action : addrReceives ,
288
304
}
@@ -301,8 +317,16 @@ func addrReceives(ctx *cli.Context) error {
301
317
addr = ctx .Args ().First ()
302
318
}
303
319
320
+ direction := taprpc .SortDirection_SORT_DIRECTION_DESC
321
+ if ctx .String (directionName ) == "asc" {
322
+ direction = taprpc .SortDirection_SORT_DIRECTION_ASC
323
+ }
324
+
304
325
resp , err := client .AddrReceives (ctxc , & taprpc.AddrReceivesRequest {
305
326
FilterAddr : addr ,
327
+ Limit : int32 (ctx .Int64 (limitName )),
328
+ Offset : int32 (ctx .Int64 (offsetName )),
329
+ Direction : direction ,
306
330
})
307
331
if err != nil {
308
332
return fmt .Errorf ("unable to query addr receives: %w" , err )
You can’t perform that action at this time.
0 commit comments