rafiki icon indicating copy to clipboard operation
rafiki copied to clipboard

Support outgoing payment withdrawal without event id

Open wilsonianb opened this issue 2 years ago • 1 comments

Account provider may prefer to poll the state of a created and funded outgoing payment to check for completion/failure and withdraw remaining liquidity. Outgoing payment liquidity withdrawal is currently only possible with the outgoing_payment.completed/outgoing_payment.failed webhook event id: https://github.com/interledger/rafiki/blob/main/packages/backend/src/graphql/schema.graphql#L101

wilsonianb avatar Aug 15 '22 20:08 wilsonianb

This would require including the liquidity account balance in the query response. This could also be expanded to apply to incoming payments and payment pointers (SPSP)

wilsonianb avatar Sep 01 '22 16:09 wilsonianb

We need to re-evaluate whether we should decouple events from withdrawing liquidity.

sabineschaller avatar Dec 12 '22 12:12 sabineschaller

If we can query for events (by type), this should not be necessary anymore.

sabineschaller avatar Mar 29 '23 08:03 sabineschaller

I think @DonChangfoot inspired this issue from his initial Rafiki integration attempt. I'm not sure if it'd be preferable for an ASE to poll specific events vs a specific outgoing payment. I'm not not sure if we'd want or be able to support querying events by specific outgoing payment id.

wilsonianb avatar Mar 29 '23 14:03 wilsonianb

Thank you @wilsonianb. I'll check with @DonChangfoot.

sabineschaller avatar Mar 29 '23 14:03 sabineschaller

Hey @sabineschaller @wilsonianb. Thanks for checking up on this

We prefer keeping track of just the id of the outgoing payment and mapping it 1-1 to our internal representation of it. We also prefer using the id of the payment to poll for its status, make a decision, and then make subsequent calls to drive it to the state we want.

Having a single id makes that a little easier. Hope that helps.

DonChangfoot avatar Mar 30 '23 07:03 DonChangfoot