Repository: Chia-Network/chia-blockchain

Issue:
[ENHANCEMENT] CLI get transactions, improve usability
**Describe the bug**
Farmed 4 blocks, only see transactions for the first 3 in the CLI.



Discussion:
I was not able to replicate this @xdustinface. Can you provide some instructions of how to replicate? Also do you mind using the main branch and seeing if the issue is present here as well?
It's not an actual issue. I just didn't follow the instructions initially :sweat_smile:. To summarize it again:

`chia wallet get_transactions` shows only [5 transactions](https://github.com/Chia-Network/chia-blockchain/blob/main/src/cmds/wallet_funcs.py#L53) by default and prints a `Press q to quit, or c to continue` after those initial transactions. I literally ignored this and assumed it's not working properly but if you type `c` and hit `Enter` it shows you more transactions, here https://github.com/Chia-Network/chia-blockchain/blob/main/src/cmds/wallet_funcs.py#L61-L67

It would probably still (imo) be good to improve this a bit and get rid of the "wait for user input in the command part". Something like a `-c/--count` + `-o/--offset` so that it shows your latest transactions by default but you can still walk through all of them by using those parameters.
The CLI is meant to be a more high level user interface, while the RPC is meant to be low level. You can fetch the json like this:
```
curl --insecure --cert ~/.chia/mainnet/config/ssl/wallet/private_wallet.crt \
--key ~/.chia/mainnet/config/ssl/wallet/private_wallet.key -d '{"wallet_id": 1}' \
-H "Content-Type: application/json" -X POST https://localhost:9256/get_transactions | python -m json.tool
```
Got it :+1: So then i guess it's ok to leave the user input to walk through transactions thing but it should imo at least become a bit more obvious by its wording and a `-o/--offset` or maybe `-s/--start-date` would probably still be good.
I think I can easily add that.

Resolving patch:
diff --git a/chia/cmds/wallet.py b/chia/cmds/wallet.py
--- a/chia/cmds/wallet.py
+++ b/chia/cmds/wallet.py
@@ -36,9 +36,18 @@ def get_transaction_cmd(wallet_rpc_port: int, fingerprint: int, id: int, tx_id:
 )
 @click.option("-f", "--fingerprint", help="Set the fingerprint to specify which wallet to use", type=int)
 @click.option("-i", "--id", help="Id of the wallet to use", type=int, default=1, show_default=True, required=True)
+@click.option(
+    "-o",
+    "--offset",
+    help="Skip transactions from the beginning of the list",
+    type=int,
+    default=0,
+    show_default=True,
+    required=True,
+)
 @click.option("--verbose", "-v", count=True, type=int)
-def get_transactions_cmd(wallet_rpc_port: int, fingerprint: int, id: int, verbose: bool) -> None:
-    extra_params = {"id": id, "verbose": verbose}
+def get_transactions_cmd(wallet_rpc_port: int, fingerprint: int, id: int, offset: int, verbose: bool) -> None:
+    extra_params = {"id": id, "verbose": verbose, "offset": offset}
     import asyncio
     from .wallet_funcs import execute_with_wallet, get_transactions
 
diff --git a/chia/cmds/wallet_funcs.py b/chia/cmds/wallet_funcs.py
--- a/chia/cmds/wallet_funcs.py
+++ b/chia/cmds/wallet_funcs.py
@@ -50,8 +50,9 @@ async def get_transactions(args: dict, wallet_client: WalletRpcClient, fingerpri
     if len(txs) == 0:
         print("There are no transactions to this address")
 
+    offset = args["offset"]
     num_per_screen = 5
-    for i in range(0, len(txs), num_per_screen):
+    for i in range(offset, len(txs), num_per_screen):
         for j in range(0, num_per_screen):
             if i + j >= len(txs):
                 break


Test patch: