mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-11-10 12:29:49 +03:00
Add --offset flag to the wallet get_transactions command (#1802)
* Add --offset flag to the wallet get_transactions command * Running black
This commit is contained in:
parent
a142f10cfd
commit
181f2fefa3
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user