2025-03-17 17:29:38 +01:00
|
|
|
from electrum.commands import plugin_command
|
|
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
|
|
|
|
|
|
if TYPE_CHECKING:
|
|
|
|
|
from .labels import LabelsPlugin
|
|
|
|
|
from electrum.commands import Commands
|
|
|
|
|
|
|
|
|
|
plugin_name = "labels"
|
|
|
|
|
|
|
|
|
|
@plugin_command('w', plugin_name)
|
|
|
|
|
async def push(self: 'Commands', plugin: 'LabelsPlugin' = None, wallet=None) -> int:
|
|
|
|
|
""" push labels to server """
|
|
|
|
|
return await plugin.push_thread(wallet)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@plugin_command('w', plugin_name)
|
|
|
|
|
async def pull(self: 'Commands', plugin: 'LabelsPlugin' = None, wallet=None, force=False) -> int:
|
2025-03-18 11:15:16 +01:00
|
|
|
"""
|
|
|
|
|
pull missing labels from server
|
|
|
|
|
|
|
|
|
|
arg:bool:force:pull all labels
|
|
|
|
|
"""
|
2025-03-17 17:29:38 +01:00
|
|
|
return await plugin.pull_thread(wallet, force=force)
|