Skip to content

jmwallet.cli.address

jmwallet.cli.address

Deposit-address management commands: reserve, label, release, and list.

These let CLI users (not only the jmwalletd HTTP API) hand out and set aside deposit addresses. A reserved address is persisted in the BIP-329 metadata store (jm:reserved records), is never reissued as the next unused deposit address, is hidden from the concise jm-wallet info view, and is shown with its optional label in jm-wallet info --extended.

Typical use case: give a distinct address to each of several payers and label them, so none is accidentally reused.

Attributes

address_app = SortedTyper(name='address', help='Manage deposit addresses: reserve, label, release, and list.', no_args_is_help=True) module-attribute

Classes

Functions:

address_label(ctx: typer.Context, address: Annotated[str, typer.Argument(help='Deposit address to reserve/label')], label: Annotated[str, typer.Argument(help='Label to attach (use quotes for spaces)')]) -> None

Reserve an existing deposit address and attach a label to it.

Reserving hides the address from jm-wallet info, shows it with the label in info --extended, and prevents it from being reissued.

Source code in jmwallet/src/jmwallet/cli/address.py
265
266
267
268
269
270
271
272
273
274
275
276
@address_app.command("label")
def address_label(
    ctx: typer.Context,
    address: Annotated[str, typer.Argument(help="Deposit address to reserve/label")],
    label: Annotated[str, typer.Argument(help="Label to attach (use quotes for spaces)")],
) -> None:
    """Reserve an existing deposit address and attach a label to it.

    Reserving hides the address from ``jm-wallet info``, shows it with the
    label in ``info --extended``, and prevents it from being reissued.
    """
    asyncio.run(_address_label(_resolve_address_context(ctx.obj), address, label))

address_list(ctx: typer.Context) -> None

List reserved deposit addresses with their mixdepth and label.

Source code in jmwallet/src/jmwallet/cli/address.py
312
313
314
315
@address_app.command("list")
def address_list(ctx: typer.Context) -> None:
    """List reserved deposit addresses with their mixdepth and label."""
    asyncio.run(_address_list(_resolve_address_context(ctx.obj)))

address_new(ctx: typer.Context, mixdepth: Annotated[int, typer.Argument(help='Mixdepth (0-4)')] = 0, label: Annotated[str, typer.Option('--label', '-l', help='Optional label to reserve the address under')] = '') -> None

Generate a fresh deposit address, reserve it, and optionally label it.

The address is verified against the backend, persisted so it is never reissued, and (with --label) shown with its label in info --extended.

Source code in jmwallet/src/jmwallet/cli/address.py
231
232
233
234
235
236
237
238
239
240
241
242
243
244
@address_app.command("new")
def address_new(
    ctx: typer.Context,
    mixdepth: Annotated[int, typer.Argument(help="Mixdepth (0-4)")] = 0,
    label: Annotated[
        str, typer.Option("--label", "-l", help="Optional label to reserve the address under")
    ] = "",
) -> None:
    """Generate a fresh deposit address, reserve it, and optionally label it.

    The address is verified against the backend, persisted so it is never
    reissued, and (with --label) shown with its label in ``info --extended``.
    """
    asyncio.run(_address_new(_resolve_address_context(ctx.obj), mixdepth, label))

address_release(ctx: typer.Context, address: Annotated[str, typer.Argument(help='Reserved address to release')]) -> None

Remove a reservation/label so the address is no longer set aside.

An address that has real on-chain history is still never reissued.

Source code in jmwallet/src/jmwallet/cli/address.py
289
290
291
292
293
294
295
296
297
298
@address_app.command("release")
def address_release(
    ctx: typer.Context,
    address: Annotated[str, typer.Argument(help="Reserved address to release")],
) -> None:
    """Remove a reservation/label so the address is no longer set aside.

    An address that has real on-chain history is still never reissued.
    """
    asyncio.run(_address_release(_resolve_address_context(ctx.obj), address))