Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API of paylink can't process a paylink with max amount 100.000.000 sat on postgres db #70

Open
lightningcheckout opened this issue Sep 27, 2024 · 1 comment

Comments

@lightningcheckout
Copy link

Today I updated my instances, but since then i run into issues in the way I create the LNurlp links.
I validated the behaviour the demo server, and the issue occur there as well. The error is:

(psycopg2.errors.NumericValueOutOfRange) integer out of range

I create a lnurlp link via the api. i.e.:

{
    "description": "Test paylink",
    "min": "1",
    "max": 100000000,
    "currency": "sat",
    "comment_chars": 255,
    "success_text": "Thank you!",
    "username": "testpaylink",
    "zaps": true
}

The response of the demo server is:

{
  "detail": "(psycopg2.errors.NumericValueOutOfRange) integer out of range\n\n[SQL: \n        INSERT INTO lnurlp.pay_links (\n            id,\n            wallet,\n            description,\n            min,\n            max,\n            served_meta,\n            served_pr,\n            webhook_url,\n            webhook_headers,\n            webhook_body,\n            success_text,\n            success_url,\n            comment_chars,\n            currency,\n            fiat_base_multiplier,\n            username,\n            zaps\n\n        )\n        VALUES (%s, %s, %s, %s, %s, 0, 0, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)\n        ]\n[parameters: ('7roBam', 'ae1c62d1abe54e43abba2566647cd0c4', 'Test paylink', 100.0, 10000000000.0, None, None, None, 'Thank you!', None, 255, 'sat', 100, 'testpaylink', True)]\n(Background on this error at: http://sqlalche.me/e/13/9h9h)"
}

Additional:

  • 10000000 sat is working fine, is there some conversion to milisats perhaps that's causing the issue?
  • I tried already the workaround of 0.00000001 - 1 btc. But in that case I run into the minimum value that is defined of 0.01.
@lightningcheckout
Copy link
Author

Did some further analyse and testing. Issue seems to be caused by the combination of "currency": "sat" and the default 'fiat_base_multiplier'.

When I leave 'currency' from the request, the paylink is created as expected.

Is this the expected behaviour? If so, this is not a valid bug and I will close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant