Skip to content

feat(wallet): add 'lock p2pk' CLI command with --timelock and --refund#914

Merged
callebtc merged 1 commit intocashubtc:mainfrom
ritoban23:feature/lock-cli-command
Mar 20, 2026
Merged

feat(wallet): add 'lock p2pk' CLI command with --timelock and --refund#914
callebtc merged 1 commit intocashubtc:mainfrom
ritoban23:feature/lock-cli-command

Conversation

@ritoban23
Copy link
Copy Markdown
Contributor

[Wallet] Add new CLI command for locking tokens

Closes #506

Changes

  • Converted cashu lock into a subcommand group with cashu lock p2pk
  • Added --timelock / -t and --refund / -r options to cashu lock p2pk
  • Added --refund / -r option to cashu send for specifying refund pubkeys
  • Fixed duplicate -l short flag conflict between --lock and --legacy on send
  • Added tests for new commands

Usage

cashu lock p2pk
cashu lock p2pk --timelock 3600 --refund 02abcdef...
cashu send 100 --lock P2PK:02abc... --refund 02def...

Refactored 'cashu lock' from a simple command into a subcommand group:
- 'cashu lock p2pk' generates a P2PK lock with optional --timelock and --refund
- Added --refund option to 'cashu send' for specifying refund pubkeys
- Fixed duplicate '-l' short flag conflict between --lock and --legacy on send

Closes cashubtc#506
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 20, 2026

Codecov Report

❌ Patch coverage is 92.85714% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.78%. Comparing base (89564fe) to head (37f28b2).
⚠️ Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
cashu/wallet/cli/cli.py 90.90% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #914      +/-   ##
==========================================
+ Coverage   61.51%   64.78%   +3.27%     
==========================================
  Files          93       93              
  Lines       11051    11073      +22     
==========================================
+ Hits         6798     7174     +376     
+ Misses       4253     3899     -354     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@callebtc callebtc merged commit fc8d9d8 into cashubtc:main Mar 20, 2026
29 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in nutshell Mar 20, 2026
jooray added a commit to jooray/nutshell that referenced this pull request Apr 1, 2026
* upstream/main: (35 commits)
  fix: add greenlet as an explicit dependency (cashubtc#913)
  fix(mint): prevent case-bypass vulnerability on SIG_ALL HTLC and P2PK
  fix(wallet,mint): fix p2pk case bypass vulnerability
  fix: support both padded and unpadded base64url in AuthProof (NUT-22) (cashubtc#920)
  Remove deprecated promises field from PostRestoreResponse (cashubtc#900)
  docs: add AGENTS.md for AI/agent workflow guidance (cashubtc#917)
  feat(lightning): add USD (Stablesats) support for Blink backend (cashubtc#869)
  feat: keysets v2 (cashubtc#798)
  feat(wallet): add 'lock p2pk' CLI command with --timelock and --refund (cashubtc#914)
  fix: enable sqlite wal mode (cashubtc#908)
  Chore: ci modernize workflows (cashubtc#911)
  fix: use -- before quote ID in management CLI tests (cashubtc#912)
  bring back python version to >=3.10
  fixed imports
  ci: ensure python 3.11 is set up for version checks
  use tomllib to extract version from pyproject
  format
  chore: add version consistency check to build workflows
  ,bump to 0.19.2 (cashubtc#896)
  forgot (cashubtc#895)
  ...

# Conflicts:
#	cashu/core/settings.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Wallet] Feature request: add new CLI command for locking tokens

3 participants