fix: accept null optional params in make_invoice and list_transactions #1

Merged
padreug merged 2 commits from fix/null-optional-params into main 2026-09-14 20:35:06 +00:00
Owner

First fork release. Carries the same fix as lnbits/nwcprovider#54: Amethyst sends unused optional make_invoice fields as explicit JSON null, dict.get doesn't default those, and description.encode() crashed with 'NoneType' object has no attribute 'encode'. Same coercion applied to list_transactions' paging params.

Three unit tests (fields omitted, null, and set) pass against upstream's lock file. Version 1.1.3-aio.1; after merge: tag, hash, catalog entry. Drop the fork commit when upstream merges #54 and we rebase.

First fork release. Carries the same fix as lnbits/nwcprovider#54: Amethyst sends unused optional `make_invoice` fields as explicit JSON `null`, `dict.get` doesn't default those, and `description.encode()` crashed with `'NoneType' object has no attribute 'encode'`. Same coercion applied to `list_transactions`' paging params. Three unit tests (fields omitted, null, and set) pass against upstream's lock file. Version `1.1.3-aio.1`; after merge: tag, hash, catalog entry. Drop the fork commit when upstream merges #54 and we rebase.
fix: accept null optional params in make_invoice and list_transactions
Some checks failed
Tests / test (push) Has been cancelled
bf55b46f76
Clients may send optional params as an explicit JSON null rather than
omitting them; Amethyst does for description, description_hash and
expiry. dict.get only applies its default for a missing key, so
description arrived as None and make_invoice failed with
"'NoneType' object has no attribute 'encode'".

Coerce with `or` instead, pass no unhashed_description when the
description is blank, and apply the same to list_transactions' paging
params, which had the same exposure.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Tbyw6FwjhEJg3gHfPHxWt
chore: bump version to 1.1.3-aio.1
Some checks failed
lint.yml / chore: bump version to 1.1.3-aio.1 (pull_request) Failing after 0s
Tests / test (push) Has been cancelled
Tests / test (pull_request) Has been cancelled
5f4dde6b53
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Tbyw6FwjhEJg3gHfPHxWt
padreug deleted branch fix/null-optional-params 2026-09-14 20:35:06 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aiolabs/nwcprovider!1
No description provided.