@@ -20,7 +20,9 @@ package transactions
2020
2121import (
2222 "context"
23+ "strings"
2324
25+ flowsdk "github.com/onflow/flow-go-sdk"
2426 "github.com/spf13/cobra"
2527
2628 "github.com/onflow/flowkit/v2"
@@ -38,10 +40,10 @@ var getSystemFlags = flagsGetSystem{}
3840
3941var getSystemCommand = & command.Command {
4042 Cmd : & cobra.Command {
41- Use : "get-system <block_id|latest|block_height>" ,
42- Short : "Get the system transaction by block info " ,
43- Example : "flow transactions get-system a1b2c3 ..." ,
44- Args : cobra .ExactArgs ( 1 ),
43+ Use : "get-system <block_id|latest|block_height> [tx_id] " ,
44+ Short : "Get the system transaction by block and optional ID " ,
45+ Example : "flow transactions get-system latest \n flow transactions get-system latest 07a8 ...b433 " ,
46+ Args : cobra .RangeArgs ( 1 , 2 ),
4547 },
4648 Flags : & getSystemFlags ,
4749 Run : getSystemTransaction ,
@@ -66,7 +68,14 @@ func getSystemTransaction(
6668 return nil , err
6769 }
6870
69- tx , result , err := flow .GetSystemTransaction (context .Background (), block .ID )
71+ var id flowsdk.Identifier
72+ if len (args ) == 2 {
73+ id = flowsdk .HexToID (strings .TrimPrefix (args [1 ], "0x" ))
74+ } else {
75+ id = flowsdk.Identifier {}
76+ }
77+
78+ tx , result , err := flow .GetSystemTransactionWithID (context .Background (), block .ID , id )
7079 if err != nil {
7180 return nil , err
7281 }
0 commit comments