Skip to content
This repository has been archived by the owner on Jan 27, 2022. It is now read-only.

How to make a payment with many parameters #29

Open
kornpow opened this issue Apr 9, 2021 · 3 comments
Open

How to make a payment with many parameters #29

kornpow opened this issue Apr 9, 2021 · 3 comments

Comments

@kornpow
Copy link

kornpow commented Apr 9, 2021

I am confused by the send_payment method, I am trying to use it similarly to other methods, but it says the argument does not exist.

>>> lnd.send_payment(
...     mypk,
...     outgoing_chan_ids=[112342341234],
...     last_hop_pubkey=base64.b64encode(getChannelRemotePK("22446688101010").encode("UTF-8")),
...     amt=12345,
...     payment_request=pr,
...     timeout_seconds=60,
...     fee_limit_msat=10000,
...     allow_self_payment=True,
...     max_parts=1,
...     no_inflight_updates=True,
... )
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/skorn/Documents/env/lib/python3.8/site-packages/lndgrpc/errors.py", line 19, in wrapper
    return fnc(*args, **kwargs)
TypeError: send_payment() got an unexpected keyword argument 'outgoing_chan_ids'

>>> lnd.send_payment(
...     mypk,
...     outgoing_chan_id=112342341234,
...     last_hop_pubkey=base64.b64encode(getChannelRemotePK("22446688101010").encode("UTF-8")),
...     amt=12345,
...     payment_request=pr,
...     timeout_seconds=60,
...     fee_limit_msat=10000,
...     allow_self_payment=True,
...     max_parts=1,
...     no_inflight_updates=True,
... )
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/skorn/Documents/env/lib/python3.8/site-packages/lndgrpc/errors.py", line 19, in wrapper
    return fnc(*args, **kwargs)
TypeError: send_payment() got an unexpected keyword argument 'outgoing_chan_id'

>>> lnd.send_payment(
...     dest=mypk,
...     outgoing_chan_id=112342341234,
...     last_hop_pubkey=base64.b64encode(getChannelRemotePK("22446688101010").encode("UTF-8")),
...     amt=12345,
...     payment_request=pr,
...     timeout_seconds=60,
...     fee_limit_msat=10000,
...     allow_self_payment=True,
...     max_parts=1,
...     no_inflight_updates=True,
... )
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/skorn/Documents/env/lib/python3.8/site-packages/lndgrpc/errors.py", line 19, in wrapper
    return fnc(*args, **kwargs)
TypeError: send_payment() got an unexpected keyword argument 'dest'

Any idea what am I doing wrong, I am trying to do a circular rebalance?

Do you know if this is using paymentV1 or PaymentV2?

@alexander-koval
Copy link

Hello. I have the same problem. I'm trying to set a fee limit and do not understand how to do it? Does any one now?

@alexander-koval
Copy link

alexander-koval commented Jul 7, 2021

So. You don't should use method directly. You should construct SendRequest by yourself.

limit = ln.FeeLimit(fixed=<amount_msat>)
request = ln.SendRequest(payment_request=<pay_req>, fee_limit=limit)
resp = self.rpc._ln_stub.SendPaymentSync(request)

@kornpow
Copy link
Author

kornpow commented Jul 7, 2021

If you want, you can make a PR to my fork, Ive been doing regular commits, and would like to hide away some of that complexity. https://github.com/sako0938/lnd-grpc-client

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

No branches or pull requests

2 participants